Mudanças entre as edições de "Redes Multimídia (diário 2014-2)"
(115 revisões intermediárias por 2 usuários não estão sendo mostradas) | |||
Linha 12: | Linha 12: | ||
Nota: os conceitos recuperados não são descartados para a composição do conceito final. | Nota: os conceitos recuperados não são descartados para a composição do conceito final. | ||
− | ==Referências | + | <center> |
+ | {| border=1 | ||
+ | |- | ||
+ | | '''Aluno''' || '''Prova 1''' || '''Prova 2''' | ||
+ | |- | ||
+ | | Diogo || A || D | ||
+ | |- | ||
+ | | Kamila || D || C | ||
+ | |- | ||
+ | | Leonardo || B || C | ||
+ | |- | ||
+ | | Marine || A || D | ||
+ | |- | ||
+ | | Michel || A || D | ||
+ | |- | ||
+ | | Rogério || A || B | ||
+ | |- | ||
+ | | Vinicius || D || D | ||
+ | |} | ||
+ | </center> | ||
+ | |||
+ | =Aulas= | ||
+ | ==Plano de ensino== | ||
+ | |||
+ | ===05/08: apresentação da disciplina=== | ||
+ | Apresentação da metodologia a ser usada na disciplina, bem como os 4 projetos que serão trabalhados ao longo do semestre. | ||
+ | |||
+ | ===08/08: revisão=== | ||
+ | Revisão de GNU/Linux e IPv4. | ||
+ | |||
+ | <code> | ||
+ | Endereçamento: | ||
+ | - Atribuir: ifconfig <iface> <IP>/<máscara> | ||
+ | - Remover: ifconfig <iface> 0 | ||
+ | - Listar: ifconfig -a | ||
+ | |||
+ | Roteamento: | ||
+ | - Ativar: sysctl -w net.ipv4.ip_forward=1 | ||
+ | - Adicionar: route add -net <rede>/<máscara> gw <roteador> dev <interface> | ||
+ | - Remover: route del -net <rede>/<máscara> gw <roteador> dev <interface> | ||
+ | - Listar: netstat -rn | ||
+ | |||
+ | Roteamento dinâmico: | ||
+ | 1) vi /etc/quagga/daemons | ||
+ | zebra=yes | ||
+ | ospfd=yes | ||
+ | 2) vi /etc/quagga/zebra.conf | ||
+ | hostname ederson | ||
+ | password zebra | ||
+ | interface eth1 | ||
+ | interface eth2 | ||
+ | 3) vi /etc/quagga/ospfd.conf | ||
+ | hostname ederson | ||
+ | password zebra | ||
+ | router ospf | ||
+ | network 192.168.10.0/29 area 0 | ||
+ | network 192.168.10.16/29 area 0 | ||
+ | |||
+ | 4) service quagga restart | ||
+ | 5) Verificar: | ||
+ | telnet localhost 2601 | ||
+ | telnet localhost 2604 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==Conceitos básicos== | ||
+ | |||
+ | ===12/08: serviços e protocolos=== | ||
+ | * Serviços | ||
+ | ** Por camada | ||
+ | * Protocolos | ||
+ | ** Tradução | ||
+ | * VoIP e telefonia IP <ref>COLCHER, S. et. al. '''VoIP: Voz sobre IP'''. 1ª ed. Elsevier. 2005. ISBN 85-352-1787-8.</ref> | ||
+ | * ''Gateway'' de mídia | ||
+ | |||
+ | ==Projeto 1: sinalização== | ||
+ | ===15/08: protocolos de sinalização=== | ||
+ | * H.225.0 (H.323) | ||
+ | * ISUP (SS7) | ||
+ | * SIP | ||
+ | |||
+ | ===19/08: SIP=== | ||
+ | * O protocolo <ref>ROSENBERG, J. et. al. '''SIP: Session Initiation Protocol'''. IETF. RFC 3261. 2002.</ref>. | ||
+ | ** UAC e UAS. | ||
+ | ** Métodos de requisição e respostas. | ||
+ | ** Servidores: ''redirect'', ''proxy'' e ''registrar''. | ||
+ | * URI, em especial <tt>sip:</tt>. | ||
+ | * Cenários possíveis de implementação: ponto-a-ponto, intracentral e intercentrais. | ||
+ | |||
+ | ===22/08: ''Soft'' PBX=== | ||
+ | * Instalação e configuração básica de dois canais SIP para operações intracentral. | ||
+ | |||
+ | ===26/08: não houve aula=== | ||
+ | Apresentação de TCCs. | ||
+ | |||
+ | ===29/08: entroncamento entre centrais=== | ||
+ | Preparação dos canais SIP: "ramais" e troncos. | ||
+ | |||
+ | ===02/09: entroncamento entre centrais=== | ||
+ | Preparação dos canais SIP: "ramais" e troncos. | ||
+ | |||
+ | ===05/09: finalização do projeto=== | ||
+ | |||
+ | ===09/09: defesa do projeto=== | ||
+ | |||
+ | ==Projeto 2: descrição e transporte de mídia== | ||
+ | |||
+ | ===12/09: SDP=== | ||
+ | * Session Description Protocol.<ref>HANDLEY, M. et. al. '''SDP: Session Description Protocol'''. IETF. RFC 4566. 2006.</ref> | ||
+ | |||
+ | ===16/09: SDP=== | ||
+ | * Session Description Protocol. | ||
+ | |||
+ | ===19/09: SDP e negociação de portas=== | ||
+ | * Negociação de portas e NAT. | ||
+ | |||
+ | ===23/09: SIP + SDP + NAT=== | ||
+ | Considere o seguinte cenário: | ||
+ | <center> | ||
+ | <graphviz> | ||
+ | graph SDP { | ||
+ | |||
+ | C [shape=record,label="<0>C|<1>eth1, .2|<2>Asterisk"] | ||
+ | D [shape=record,label="<0>D|<1>eth1, .2|<2>Asterisk"] | ||
+ | E [shape=record,label="<0>E|<1>eth1, .1|<2>eth2, .1"] | ||
+ | F [shape=record,label="<0>F|<1>eth1, .1|<2>eth2, .2"] | ||
+ | |||
+ | CE [shape=plaintext,label="192.168.10.0/24"] | ||
+ | EF [shape=plaintext,label="192.168.20.0/24"] | ||
+ | FD [shape=plaintext,label="192.168.30.0/24"] | ||
+ | |||
+ | C:1 -- CE -- E:1 | ||
+ | E:2 -- EF -- F:2 | ||
+ | F:1 -- FD -- D:1 | ||
+ | |||
+ | C:2 -- D:2 [color=red,fontcolor=red,label="Tronco SIP"] | ||
+ | } | ||
+ | </graphviz> | ||
+ | </center> | ||
+ | |||
+ | ====Configuração de rede==== | ||
+ | C: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | # Ativa Enlace | ||
+ | ip link set eth1 up | ||
+ | # | ||
+ | # Configura endereço IPv4 | ||
+ | ip address add 192.168.10.2/24 broadcast 192.168.10.255 dev eth1 scope site | ||
+ | # | ||
+ | # Configura tabela de roteamento IPv4 | ||
+ | ip route add 0.0.0.0/0 via 192.168.10.1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | # Ativa Enlace | ||
+ | ip link set eth1 up | ||
+ | # | ||
+ | # Configura endereço IPv4 | ||
+ | ip address add 192.168.30.2/24 broadcast 192.168.30.255 dev eth1 scope site | ||
+ | # | ||
+ | # Configura tabela de roteamento IPv4 | ||
+ | ip route add 0.0.0.0/0 via 192.168.30.1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * E: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | # Ativa Enlaces | ||
+ | ip link set eth1 up | ||
+ | ip link set eth2 up | ||
+ | # | ||
+ | # Configura endereços IPv4 | ||
+ | ip address add 192.168.10.1/24 broadcast 192.168.10.255 dev eth1 scope site | ||
+ | ip address add 192.168.20.1/24 broadcast 192.168.20.255 dev eth2 scope site | ||
+ | # | ||
+ | # Configura tabela de roteamento IPv4 | ||
+ | ip route add 192.168.30.0/24 via 192.168.20.2 | ||
+ | # | ||
+ | # Ativa roteamento entre interfaces | ||
+ | sysctl -w net.ipv4.ip_forward=1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * F: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | # Ativa Enlaces | ||
+ | ip link set eth1 up | ||
+ | ip link set eth2 up | ||
+ | # | ||
+ | # Configura endereços IPv4 | ||
+ | ip address add 192.168.30.1/24 broadcast 192.168.30.255 dev eth1 scope site | ||
+ | ip address add 192.168.20.2/24 broadcast 192.168.20.255 dev eth2 scope site | ||
+ | # | ||
+ | # Configura tabela de roteamento IPv4 | ||
+ | ip route add 192.168.10.0/24 via 192.168.20.1 | ||
+ | # | ||
+ | # Ativa roteamento entre interfaces | ||
+ | sysctl -w net.ipv4.ip_forward=1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Configuração do Asterisk==== | ||
+ | * C, <tt>sip.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/sip.conf << FIM | ||
+ | [a] | ||
+ | type=friend | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=dynamic | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | allow=ulaw | ||
+ | allow=gsm | ||
+ | |||
+ | [cd] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.30.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | |||
+ | [dc] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.30.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * C, <tt>extensions.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/extensions.conf << FIM | ||
+ | [rmu20142] | ||
+ | ; | ||
+ | ; Local: "100" ou "a" | ||
+ | exten => 100,1,Dial(SIP/a) | ||
+ | exten => 100,n,Hangup() | ||
+ | exten => a,1,Dial(SIP/\${EXTEN}) | ||
+ | exten => a,n,Hangup() | ||
+ | ; | ||
+ | ; Remoto via tronco SIP: "0" antecipando demais caracteres | ||
+ | exten => _0.,1,Dial(SIP/cd/\${EXTEN:1}) | ||
+ | exten => _0.,n,Hangup() | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * C, execução do Asterisk: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | asterisk -cn | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, <tt>sip.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/sip.conf << FIM | ||
+ | [b] | ||
+ | type=friend | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=dynamic | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | allow=ulaw | ||
+ | allow=gsm | ||
+ | |||
+ | [cd] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.10.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | |||
+ | [dc] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.10.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, <tt>extensions.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/extensions.conf << FIM | ||
+ | [rmu20142] | ||
+ | ; | ||
+ | ; Local: "100" ou "b" | ||
+ | exten => 100,1,Dial(SIP/b) | ||
+ | exten => 100,n,Hangup() | ||
+ | exten => b,1,Dial(SIP/\${EXTEN}) | ||
+ | exten => b,n,Hangup() | ||
+ | ; | ||
+ | ; Remoto via tronco SIP: "0" antecipando demais caracteres | ||
+ | exten => _0.,1,Dial(SIP/dc/\${EXTEN:1}) | ||
+ | exten => _0.,n,Hangup() | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, execução do Asterisk: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | asterisk -cn | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Configuração do Cliente==== | ||
+ | Utilizado pjsua<ref>PJSIP. '''pjsua'''. http://www.pjsip.org/pjsua.htm. 2014.</ref> para se registrar no servidor C: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > ${HOME}/pjsua.cfg << FIM | ||
+ | --registrar sip:192.168.10.2 | ||
+ | --proxy sip:192.168.10.2;lr | ||
+ | --realm * | ||
+ | --id sip:a@192.168.10.2 | ||
+ | --username a | ||
+ | --local-port 50600 | ||
+ | --null-audio | ||
+ | FIM | ||
+ | pjsua --config-file=${HOME}/pjsua.cfg | ||
+ | </syntaxhighlight> | ||
+ | e no servidor D: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > ${HOME}/pjsua.cfg << FIM | ||
+ | --registrar sip:192.168.30.2 | ||
+ | --proxy sip:192.168.30.2;lr | ||
+ | --realm * | ||
+ | --id sip:b@192.168.30.2 | ||
+ | --username b | ||
+ | --local-port 50600 | ||
+ | --null-audio | ||
+ | FIM | ||
+ | pjsua --config-file=${HOME}/pjsua.cfg | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===26/09: SIP + SDP + NAT=== | ||
+ | * Continuação da atividade anterior. | ||
+ | |||
+ | ===30/09: Codecs=== | ||
+ | * Codecs. | ||
+ | * Metarquivos: JPEG, MPEG. | ||
+ | * Camadas de sessão, apresentação e aplicação. | ||
+ | |||
+ | ===03/10: IPv6=== | ||
+ | ===07/10: IPv6 e SIP=== | ||
+ | Cenário usando [[Netkit]]: | ||
+ | <code> | ||
+ | global[compact]=False | ||
+ | global[mem]=32 | ||
+ | global[vm]=4 | ||
+ | global[clean]=False | ||
+ | global[path]=/tmp/rmu20142/lab | ||
+ | |||
+ | C[type]=generic | ||
+ | D[type]=generic | ||
+ | E[type]=generic | ||
+ | F[type]=generic | ||
+ | |||
+ | C[eth1]=CE | ||
+ | E[eth1]=CE | ||
+ | |||
+ | E[eth2]=EF | ||
+ | F[eth2]=EF | ||
+ | |||
+ | D[eth1]=DF | ||
+ | F[eth1]=DF | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Configuração de rede: | ||
+ | * C: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | ip link set eth1 up | ||
+ | ip -4 address add 192.168.10.2/24 dev eth1 scope site | ||
+ | ip -4 route add 0.0.0.0/0 via 192.168.10.1 scope site | ||
+ | ip -6 address add 2804:1454:0:2010::2/64 dev eth1 scope global | ||
+ | ip -6 route add ::/0 via 2804:1454:0:2010::1 | ||
+ | </syntaxhighlight> | ||
+ | * D: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | ip link set eth1 up | ||
+ | ip -4 address add 192.168.30.2/24 dev eth1 scope site | ||
+ | ip -4 route add 0.0.0.0/0 via 192.168.30.1 scope site | ||
+ | ip -6 address add 2804:1454:0:2030::2/64 dev eth1 scope global | ||
+ | ip -6 route add ::0/0 via 2804:1454:0:2030::1 | ||
+ | </syntaxhighlight> | ||
+ | * E: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | ip link set eth1 up | ||
+ | ip link set eth2 up | ||
+ | ip -4 address add 192.168.10.1/24 dev eth1 scope site | ||
+ | ip -4 address add 192.168.20.1/24 dev eth2 scope site | ||
+ | ip -4 route add 192.168.30.0/24 via 192.168.20.2 | ||
+ | sysctl -w net.ipv4.conf.all.forwarding=1 | ||
+ | ip -6 address add 2804:1454:0:2010::1/64 dev eth1 scope global | ||
+ | ip -6 address add 2804:1454:0:2037::1/64 dev eth2 scope global | ||
+ | ip -6 route add 2804:1454:0:2030::/64 via 2804:1454:0:2037::2 | ||
+ | sysctl -w net.ipv6.conf.all.forwarding=1 | ||
+ | </syntaxhighlight> | ||
+ | * F: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | ip link set eth1 up | ||
+ | ip link set eth2 up | ||
+ | ip -4 address add 192.168.30.1/24 dev eth1 scope site | ||
+ | ip -4 address add 192.168.20.2/24 dev eth2 scope site | ||
+ | ip -4 route add 192.168.10.0/24 via 192.168.20.1 | ||
+ | sysctl -w net.ipv4.conf.all.forwarding=1 | ||
+ | ip -6 address add 2804:1454:0:2030::1/64 dev eth1 scope global | ||
+ | ip -6 address add 2804:1454:0:2037::2/64 dev eth2 scope global | ||
+ | ip -6 route add 2804:1454:0:2010::/64 via 2804:1454:0:2037::1 | ||
+ | sysctl -w net.ipv6.conf.all.forwarding=1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Configuração do Asterisk==== | ||
+ | * C, <tt>sip.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/sip.conf << FIM | ||
+ | [general] | ||
+ | ; Suporte a IPv6 | ||
+ | udpbindaddr=:: | ||
+ | |||
+ | [a] | ||
+ | type=friend | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=dynamic | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | allow=ulaw | ||
+ | allow=gsm | ||
+ | |||
+ | [cd-ipv4] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.30.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [cd-ipv6] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=2804:1454:0:2030::2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [dc-ipv4] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.30.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [dc-ipv6] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=2804:1454:0:2030::2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * C, <tt>extensions.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/extensions.conf << FIM | ||
+ | [rmu20142] | ||
+ | ; | ||
+ | ; Local: "100" ou "a" | ||
+ | exten => 100,1,Dial(SIP/a) | ||
+ | exten => 100,n,Hangup() | ||
+ | exten => a,1,Dial(SIP/\${EXTEN}) | ||
+ | exten => a,n,Hangup() | ||
+ | ; | ||
+ | ; Remoto via tronco SIP: "0" antecipando demais caracteres | ||
+ | exten => _0.,1,Dial(SIP/cd-ipv6/\${EXTEN:1}) | ||
+ | exten => _0.,n,Dial(SIP/cd-ipv4/\${EXTEN:1}) | ||
+ | exten => _0.,n,Hangup() | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * C, execução do Asterisk: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | /etc/init.d/asterisk start | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, <tt>sip.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/sip.conf << FIM | ||
+ | [general] | ||
+ | ; Suporte a IPv6 | ||
+ | udpbindaddr=:: | ||
+ | |||
+ | [b] | ||
+ | type=friend | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=dynamic | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | allow=ulaw | ||
+ | allow=gsm | ||
+ | |||
+ | [cd-ipv4] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.10.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [cd-ipv6] | ||
+ | type=user | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=2804:1454:0:2010::2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [dc-ipv4] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=192.168.10.2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | |||
+ | [dc-ipv6] | ||
+ | type=peer | ||
+ | context=rmu20142 | ||
+ | ; | ||
+ | ; SIP | ||
+ | host=2804:1454:0:2010::2 | ||
+ | qualify=yes | ||
+ | insecure=port,invite | ||
+ | ; | ||
+ | ; SDP | ||
+ | disallow=all | ||
+ | allow=alaw | ||
+ | directmedia=no | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, <tt>extensions.conf</tt>: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > /etc/asterisk/extensions.conf << FIM | ||
+ | [rmu20142] | ||
+ | ; | ||
+ | ; Local: "100" ou "b" | ||
+ | exten => 100,1,Dial(SIP/b) | ||
+ | exten => 100,n,Hangup() | ||
+ | exten => b,1,Dial(SIP/\${EXTEN}) | ||
+ | exten => b,n,Hangup() | ||
+ | ; | ||
+ | ; Remoto via tronco SIP: "0" antecipando demais caracteres | ||
+ | exten => _0.,1,Dial(SIP/dc-ipv6/\${EXTEN:1}) | ||
+ | exten => _0.,n,Dial(SIP/dc-ipv4/\${EXTEN:1}) | ||
+ | exten => _0.,n,Hangup() | ||
+ | FIM | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * D, execução do Asterisk: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | /etc/init.d/asterisk start | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Configuração do Cliente==== | ||
+ | Para se registrar no servidor C: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > ${HOME}/pjsua.cfg << FIM | ||
+ | --registrar sip:192.168.10.2 | ||
+ | --proxy sip:192.168.10.2;lr | ||
+ | --realm * | ||
+ | --id sip:a@192.168.10.2 | ||
+ | --username a | ||
+ | --local-port 50600 | ||
+ | --null-audio | ||
+ | FIM | ||
+ | pjsua --config-file=${HOME}/pjsua.cfg | ||
+ | </syntaxhighlight> | ||
+ | e no servidor D: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cat > ${HOME}/pjsua.cfg << FIM | ||
+ | --registrar sip:192.168.30.2 | ||
+ | --proxy sip:192.168.30.2;lr | ||
+ | --realm * | ||
+ | --id sip:b@192.168.30.2 | ||
+ | --username b | ||
+ | --local-port 50600 | ||
+ | --null-audio | ||
+ | FIM | ||
+ | pjsua --config-file=${HOME}/pjsua.cfg | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===10/10: IPv6 e SIP=== | ||
+ | Atividade em sala: | ||
+ | # Criar canais SIP sobre IPv6 e sobre IPv4 entre centrais (arquivo <tt>sip.conf</tt>). | ||
+ | # Definir sequência de prioridade no uso de canal IPv6 ou IPv4 (arquivo <tt>extensions.conf</tt>). | ||
+ | # Utilizar IPv4 nos terminais/ramais (entre A e C, entre B e D) e IPv6 entre centrais (entre C e D). | ||
+ | # Verificar como se comportaram os cabeçalhos em IPv4 e IPv6 nos vários segmentos da transmissão: | ||
+ | ## <tt>From</tt>. | ||
+ | ## <tt>To</tt>. | ||
+ | ## <tt>Contact</tt>. | ||
+ | ## <tt>Call-ID</tt>. | ||
+ | ## <tt>Via</tt>. | ||
+ | |||
+ | A prova será baseada nesta atividade. | ||
+ | |||
+ | ===14/10: revisão da prova=== | ||
+ | |||
+ | ===?: RTP=== | ||
+ | * RTP e RTCP.<ref>SCHULZRINNE, H. et. al. '''RTP: A Transport Protocol for Real-Time Applications'''. IETF. RFC 3550. 2003.</ref> | ||
+ | |||
+ | ==Projeto 3: qualidade de serviço== | ||
+ | |||
+ | ===07/11: sem aula=== | ||
+ | Leitura extraclasse: | ||
+ | * IntServ | ||
+ | * DiffServ | ||
+ | * TOS / DSCP / Traffic Class | ||
+ | |||
+ | ===25/111: aplicação e acompanhamento da política=== | ||
+ | Para monitorar o tráfego já marcado: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | tcpdump -ni INTERFACE '(ip and (ip[1] & 0xfc) >> 2 == DSCP)' | ||
+ | </syntaxhighlight> | ||
+ | onde <tt>INTERFACE</tt> é a interface de rede a ser monitorada e <tt>DSCP</tt> é o código DSCP. | ||
+ | |||
+ | No nosso cenário, temos como interface <tt>eth2</tt> e 3 códigos em uso: | ||
+ | * 0: tráfego regular. | ||
+ | * 40: sinalização. | ||
+ | * 46: mídia. | ||
+ | |||
+ | ==Projeto 4: interoperabilidade== | ||
+ | * Segurança: SIP sobre TLS, SRTP. | ||
+ | * WebRTC.<ref>Google. '''[http://webrtc.org WebRTC]'''. 2012.</ref> | ||
+ | |||
+ | ===02/12: WebRTC=== | ||
+ | Material baseado na [https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5 wiki do Asterisk]: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd /usr/local/asterisk-11 | ||
+ | cat > etc/asterisk/http.conf << EOF | ||
+ | [general] | ||
+ | enabled=yes | ||
+ | bindaddr=0.0.0.0 | ||
+ | bindport=8088 | ||
+ | EOF | ||
+ | cat > etc/asterisk/rtp.conf << EOF | ||
+ | [general] | ||
+ | rtpstart=10000 | ||
+ | rtpend=20000 | ||
+ | stunaddr=tele.sj.ifsc.edu.br | ||
+ | EOF | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | No arquivo <tt>etc/asterisk/sip.conf</tt> deve-se adicionar o suporte a ''websocket'' em protocolos: | ||
+ | <code> | ||
+ | ... | ||
+ | [general] | ||
+ | ... | ||
+ | transport=tcp,udp,ws | ||
+ | ... | ||
+ | </syntaxhighlight> | ||
+ | e, também, o suporte a ''WebSocket'' e SRTP para o canal SIP> | ||
+ | <code> | ||
+ | [a] | ||
+ | ... | ||
+ | directmedia=no | ||
+ | ; | ||
+ | ; Suporte a STUN/ICE | ||
+ | icesupport=yes | ||
+ | ; | ||
+ | ; Suporte a áudio e vídeo | ||
+ | avpf=yes | ||
+ | force_avp=yes | ||
+ | ; | ||
+ | ; SRTP | ||
+ | encryption=yes | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | A testar com algum ''softphone'', como por exemplo [http://sipml5.org/ sipML5]. | ||
+ | |||
+ | =Referências= | ||
<references/> | <references/> |
Edição atual tal como às 19h45min de 2 de dezembro de 2014
URL encurtada: https://bit.ly/rmu20142
Sobre a disciplina
Metodologia e Avaliação
Abordagem baseada em projetos cumulativos ao longo da disciplina, com avaliação prática em laboratório (defesa do cenário). Serão compostas "empresas", com definição de papéis de líderes e liderados (sob regime de rodízio ao longo da disciplina), para defesa e composição coletiva do conceito.
Composição do Conceito Final
- A = todos os conceitos A.
- B = no máximo um conceito C e nenhum D (incluindo recuperação e avaliação recuperada).
- C = no máximo um conceito D (exceto projeto final), e para cada D um A correspondente (incluindo recuperação e avaliação recuperada).
- D = demais casos.
Nota: os conceitos recuperados não são descartados para a composição do conceito final.
Aluno | Prova 1 | Prova 2 |
Diogo | A | D |
Kamila | D | C |
Leonardo | B | C |
Marine | A | D |
Michel | A | D |
Rogério | A | B |
Vinicius | D | D |
Aulas
Plano de ensino
05/08: apresentação da disciplina
Apresentação da metodologia a ser usada na disciplina, bem como os 4 projetos que serão trabalhados ao longo do semestre.
08/08: revisão
Revisão de GNU/Linux e IPv4.
Endereçamento:
- Atribuir: ifconfig <iface> <IP>/<máscara>
- Remover: ifconfig <iface> 0
- Listar: ifconfig -a
Roteamento:
- Ativar: sysctl -w net.ipv4.ip_forward=1
- Adicionar: route add -net <rede>/<máscara> gw <roteador> dev <interface>
- Remover: route del -net <rede>/<máscara> gw <roteador> dev <interface>
- Listar: netstat -rn
Roteamento dinâmico:
1) vi /etc/quagga/daemons
zebra=yes
ospfd=yes
2) vi /etc/quagga/zebra.conf
hostname ederson
password zebra
interface eth1
interface eth2
3) vi /etc/quagga/ospfd.conf
hostname ederson
password zebra
router ospf
network 192.168.10.0/29 area 0
network 192.168.10.16/29 area 0
4) service quagga restart
5) Verificar:
telnet localhost 2601
telnet localhost 2604
</syntaxhighlight>
Conceitos básicos
12/08: serviços e protocolos
- Serviços
- Por camada
- Protocolos
- Tradução
- VoIP e telefonia IP [1]
- Gateway de mídia
Projeto 1: sinalização
15/08: protocolos de sinalização
- H.225.0 (H.323)
- ISUP (SS7)
- SIP
19/08: SIP
- O protocolo [2].
- UAC e UAS.
- Métodos de requisição e respostas.
- Servidores: redirect, proxy e registrar.
- URI, em especial sip:.
- Cenários possíveis de implementação: ponto-a-ponto, intracentral e intercentrais.
22/08: Soft PBX
- Instalação e configuração básica de dois canais SIP para operações intracentral.
26/08: não houve aula
Apresentação de TCCs.
29/08: entroncamento entre centrais
Preparação dos canais SIP: "ramais" e troncos.
02/09: entroncamento entre centrais
Preparação dos canais SIP: "ramais" e troncos.
05/09: finalização do projeto
09/09: defesa do projeto
Projeto 2: descrição e transporte de mídia
12/09: SDP
- Session Description Protocol.[3]
16/09: SDP
- Session Description Protocol.
19/09: SDP e negociação de portas
- Negociação de portas e NAT.
23/09: SIP + SDP + NAT
Considere o seguinte cenário:
<graphviz>
graph SDP {
C [shape=record,label="<0>C|<1>eth1, .2|<2>Asterisk"]
D [shape=record,label="<0>D|<1>eth1, .2|<2>Asterisk"]
E [shape=record,label="<0>E|<1>eth1, .1|<2>eth2, .1"]
F [shape=record,label="<0>F|<1>eth1, .1|<2>eth2, .2"]
CE [shape=plaintext,label="192.168.10.0/24"]
EF [shape=plaintext,label="192.168.20.0/24"]
FD [shape=plaintext,label="192.168.30.0/24"]
C:1 -- CE -- E:1
E:2 -- EF -- F:2
F:1 -- FD -- D:1
C:2 -- D:2 [color=red,fontcolor=red,label="Tronco SIP"]
}
</graphviz>
Configuração de rede
C:
# Ativa Enlace
ip link set eth1 up
#
# Configura endereço IPv4
ip address add 192.168.10.2/24 broadcast 192.168.10.255 dev eth1 scope site
#
# Configura tabela de roteamento IPv4
ip route add 0.0.0.0/0 via 192.168.10.1
- D:
# Ativa Enlace
ip link set eth1 up
#
# Configura endereço IPv4
ip address add 192.168.30.2/24 broadcast 192.168.30.255 dev eth1 scope site
#
# Configura tabela de roteamento IPv4
ip route add 0.0.0.0/0 via 192.168.30.1
- E:
# Ativa Enlaces
ip link set eth1 up
ip link set eth2 up
#
# Configura endereços IPv4
ip address add 192.168.10.1/24 broadcast 192.168.10.255 dev eth1 scope site
ip address add 192.168.20.1/24 broadcast 192.168.20.255 dev eth2 scope site
#
# Configura tabela de roteamento IPv4
ip route add 192.168.30.0/24 via 192.168.20.2
#
# Ativa roteamento entre interfaces
sysctl -w net.ipv4.ip_forward=1
- F:
# Ativa Enlaces
ip link set eth1 up
ip link set eth2 up
#
# Configura endereços IPv4
ip address add 192.168.30.1/24 broadcast 192.168.30.255 dev eth1 scope site
ip address add 192.168.20.2/24 broadcast 192.168.20.255 dev eth2 scope site
#
# Configura tabela de roteamento IPv4
ip route add 192.168.10.0/24 via 192.168.20.1
#
# Ativa roteamento entre interfaces
sysctl -w net.ipv4.ip_forward=1
Configuração do Asterisk
- C, sip.conf:
cat > /etc/asterisk/sip.conf << FIM
[a]
type=friend
context=rmu20142
;
; SIP
host=dynamic
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
allow=ulaw
allow=gsm
[cd]
type=peer
context=rmu20142
;
; SIP
host=192.168.30.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
[dc]
type=user
context=rmu20142
;
; SIP
host=192.168.30.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
FIM
- C, extensions.conf:
cat > /etc/asterisk/extensions.conf << FIM
[rmu20142]
;
; Local: "100" ou "a"
exten => 100,1,Dial(SIP/a)
exten => 100,n,Hangup()
exten => a,1,Dial(SIP/\${EXTEN})
exten => a,n,Hangup()
;
; Remoto via tronco SIP: "0" antecipando demais caracteres
exten => _0.,1,Dial(SIP/cd/\${EXTEN:1})
exten => _0.,n,Hangup()
FIM
- C, execução do Asterisk:
asterisk -cn
- D, sip.conf:
cat > /etc/asterisk/sip.conf << FIM
[b]
type=friend
context=rmu20142
;
; SIP
host=dynamic
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
allow=ulaw
allow=gsm
[cd]
type=user
context=rmu20142
;
; SIP
host=192.168.10.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
[dc]
type=peer
context=rmu20142
;
; SIP
host=192.168.10.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
FIM
- D, extensions.conf:
cat > /etc/asterisk/extensions.conf << FIM
[rmu20142]
;
; Local: "100" ou "b"
exten => 100,1,Dial(SIP/b)
exten => 100,n,Hangup()
exten => b,1,Dial(SIP/\${EXTEN})
exten => b,n,Hangup()
;
; Remoto via tronco SIP: "0" antecipando demais caracteres
exten => _0.,1,Dial(SIP/dc/\${EXTEN:1})
exten => _0.,n,Hangup()
FIM
- D, execução do Asterisk:
asterisk -cn
Configuração do Cliente
Utilizado pjsua[4] para se registrar no servidor C:
cat > ${HOME}/pjsua.cfg << FIM
--registrar sip:192.168.10.2
--proxy sip:192.168.10.2;lr
--realm *
--id sip:a@192.168.10.2
--username a
--local-port 50600
--null-audio
FIM
pjsua --config-file=${HOME}/pjsua.cfg
e no servidor D:
cat > ${HOME}/pjsua.cfg << FIM
--registrar sip:192.168.30.2
--proxy sip:192.168.30.2;lr
--realm *
--id sip:b@192.168.30.2
--username b
--local-port 50600
--null-audio
FIM
pjsua --config-file=${HOME}/pjsua.cfg
26/09: SIP + SDP + NAT
- Continuação da atividade anterior.
30/09: Codecs
- Codecs.
- Metarquivos: JPEG, MPEG.
- Camadas de sessão, apresentação e aplicação.
03/10: IPv6
07/10: IPv6 e SIP
Cenário usando Netkit:
global[compact]=False
global[mem]=32
global[vm]=4
global[clean]=False
global[path]=/tmp/rmu20142/lab
C[type]=generic
D[type]=generic
E[type]=generic
F[type]=generic
C[eth1]=CE
E[eth1]=CE
E[eth2]=EF
F[eth2]=EF
D[eth1]=DF
F[eth1]=DF
</syntaxhighlight>
Configuração de rede:
- C:
ip link set eth1 up
ip -4 address add 192.168.10.2/24 dev eth1 scope site
ip -4 route add 0.0.0.0/0 via 192.168.10.1 scope site
ip -6 address add 2804:1454:0:2010::2/64 dev eth1 scope global
ip -6 route add ::/0 via 2804:1454:0:2010::1
- D:
ip link set eth1 up
ip -4 address add 192.168.30.2/24 dev eth1 scope site
ip -4 route add 0.0.0.0/0 via 192.168.30.1 scope site
ip -6 address add 2804:1454:0:2030::2/64 dev eth1 scope global
ip -6 route add ::0/0 via 2804:1454:0:2030::1
- E:
ip link set eth1 up
ip link set eth2 up
ip -4 address add 192.168.10.1/24 dev eth1 scope site
ip -4 address add 192.168.20.1/24 dev eth2 scope site
ip -4 route add 192.168.30.0/24 via 192.168.20.2
sysctl -w net.ipv4.conf.all.forwarding=1
ip -6 address add 2804:1454:0:2010::1/64 dev eth1 scope global
ip -6 address add 2804:1454:0:2037::1/64 dev eth2 scope global
ip -6 route add 2804:1454:0:2030::/64 via 2804:1454:0:2037::2
sysctl -w net.ipv6.conf.all.forwarding=1
- F:
ip link set eth1 up
ip link set eth2 up
ip -4 address add 192.168.30.1/24 dev eth1 scope site
ip -4 address add 192.168.20.2/24 dev eth2 scope site
ip -4 route add 192.168.10.0/24 via 192.168.20.1
sysctl -w net.ipv4.conf.all.forwarding=1
ip -6 address add 2804:1454:0:2030::1/64 dev eth1 scope global
ip -6 address add 2804:1454:0:2037::2/64 dev eth2 scope global
ip -6 route add 2804:1454:0:2010::/64 via 2804:1454:0:2037::1
sysctl -w net.ipv6.conf.all.forwarding=1
Configuração do Asterisk
- C, sip.conf:
cat > /etc/asterisk/sip.conf << FIM
[general]
; Suporte a IPv6
udpbindaddr=::
[a]
type=friend
context=rmu20142
;
; SIP
host=dynamic
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
allow=ulaw
allow=gsm
[cd-ipv4]
type=peer
context=rmu20142
;
; SIP
host=192.168.30.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[cd-ipv6]
type=peer
context=rmu20142
;
; SIP
host=2804:1454:0:2030::2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[dc-ipv4]
type=user
context=rmu20142
;
; SIP
host=192.168.30.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[dc-ipv6]
type=user
context=rmu20142
;
; SIP
host=2804:1454:0:2030::2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
FIM
- C, extensions.conf:
cat > /etc/asterisk/extensions.conf << FIM
[rmu20142]
;
; Local: "100" ou "a"
exten => 100,1,Dial(SIP/a)
exten => 100,n,Hangup()
exten => a,1,Dial(SIP/\${EXTEN})
exten => a,n,Hangup()
;
; Remoto via tronco SIP: "0" antecipando demais caracteres
exten => _0.,1,Dial(SIP/cd-ipv6/\${EXTEN:1})
exten => _0.,n,Dial(SIP/cd-ipv4/\${EXTEN:1})
exten => _0.,n,Hangup()
FIM
- C, execução do Asterisk:
/etc/init.d/asterisk start
- D, sip.conf:
cat > /etc/asterisk/sip.conf << FIM
[general]
; Suporte a IPv6
udpbindaddr=::
[b]
type=friend
context=rmu20142
;
; SIP
host=dynamic
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
allow=ulaw
allow=gsm
[cd-ipv4]
type=user
context=rmu20142
;
; SIP
host=192.168.10.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[cd-ipv6]
type=user
context=rmu20142
;
; SIP
host=2804:1454:0:2010::2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[dc-ipv4]
type=peer
context=rmu20142
;
; SIP
host=192.168.10.2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
[dc-ipv6]
type=peer
context=rmu20142
;
; SIP
host=2804:1454:0:2010::2
qualify=yes
insecure=port,invite
;
; SDP
disallow=all
allow=alaw
directmedia=no
FIM
- D, extensions.conf:
cat > /etc/asterisk/extensions.conf << FIM
[rmu20142]
;
; Local: "100" ou "b"
exten => 100,1,Dial(SIP/b)
exten => 100,n,Hangup()
exten => b,1,Dial(SIP/\${EXTEN})
exten => b,n,Hangup()
;
; Remoto via tronco SIP: "0" antecipando demais caracteres
exten => _0.,1,Dial(SIP/dc-ipv6/\${EXTEN:1})
exten => _0.,n,Dial(SIP/dc-ipv4/\${EXTEN:1})
exten => _0.,n,Hangup()
FIM
- D, execução do Asterisk:
/etc/init.d/asterisk start
Configuração do Cliente
Para se registrar no servidor C:
cat > ${HOME}/pjsua.cfg << FIM
--registrar sip:192.168.10.2
--proxy sip:192.168.10.2;lr
--realm *
--id sip:a@192.168.10.2
--username a
--local-port 50600
--null-audio
FIM
pjsua --config-file=${HOME}/pjsua.cfg
e no servidor D:
cat > ${HOME}/pjsua.cfg << FIM
--registrar sip:192.168.30.2
--proxy sip:192.168.30.2;lr
--realm *
--id sip:b@192.168.30.2
--username b
--local-port 50600
--null-audio
FIM
pjsua --config-file=${HOME}/pjsua.cfg
10/10: IPv6 e SIP
Atividade em sala:
- Criar canais SIP sobre IPv6 e sobre IPv4 entre centrais (arquivo sip.conf).
- Definir sequência de prioridade no uso de canal IPv6 ou IPv4 (arquivo extensions.conf).
- Utilizar IPv4 nos terminais/ramais (entre A e C, entre B e D) e IPv6 entre centrais (entre C e D).
- Verificar como se comportaram os cabeçalhos em IPv4 e IPv6 nos vários segmentos da transmissão:
- From.
- To.
- Contact.
- Call-ID.
- Via.
A prova será baseada nesta atividade.
14/10: revisão da prova
?: RTP
- RTP e RTCP.[5]
Projeto 3: qualidade de serviço
07/11: sem aula
Leitura extraclasse:
- IntServ
- DiffServ
- TOS / DSCP / Traffic Class
25/111: aplicação e acompanhamento da política
Para monitorar o tráfego já marcado:
tcpdump -ni INTERFACE '(ip and (ip[1] & 0xfc) >> 2 == DSCP)'
onde INTERFACE é a interface de rede a ser monitorada e DSCP é o código DSCP.
No nosso cenário, temos como interface eth2 e 3 códigos em uso:
- 0: tráfego regular.
- 40: sinalização.
- 46: mídia.
Projeto 4: interoperabilidade
- Segurança: SIP sobre TLS, SRTP.
- WebRTC.[6]
02/12: WebRTC
Material baseado na wiki do Asterisk:
cd /usr/local/asterisk-11
cat > etc/asterisk/http.conf << EOF
[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
EOF
cat > etc/asterisk/rtp.conf << EOF
[general]
rtpstart=10000
rtpend=20000
stunaddr=tele.sj.ifsc.edu.br
EOF
No arquivo etc/asterisk/sip.conf deve-se adicionar o suporte a websocket em protocolos:
...
[general]
...
transport=tcp,udp,ws
...
</syntaxhighlight>
e, também, o suporte a WebSocket e SRTP para o canal SIP>
[a]
...
directmedia=no
- Suporte a STUN/ICE
icesupport=yes
- Suporte a áudio e vídeo
avpf=yes
force_avp=yes
- SRTP
encryption=yes
</syntaxhighlight>
A testar com algum softphone, como por exemplo sipML5.
Referências
- ↑ COLCHER, S. et. al. VoIP: Voz sobre IP. 1ª ed. Elsevier. 2005. ISBN 85-352-1787-8.
- ↑ ROSENBERG, J. et. al. SIP: Session Initiation Protocol. IETF. RFC 3261. 2002.
- ↑ HANDLEY, M. et. al. SDP: Session Description Protocol. IETF. RFC 4566. 2006.
- ↑ PJSIP. pjsua. http://www.pjsip.org/pjsua.htm. 2014.
- ↑ SCHULZRINNE, H. et. al. RTP: A Transport Protocol for Real-Time Applications. IETF. RFC 3550. 2003.
- ↑ Google. WebRTC. 2012.