Mudanças entre as edições de "Redes de Computadores II (diário 2014-2)"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
Linha 416: Linha 416:
 
# Rede: roteamento IPv6
 
# Rede: roteamento IPv6
 
sysctl -w net.ipv6.conf.all.forwarding=1
 
sysctl -w net.ipv6.conf.all.forwarding=1
 +
</syntaxhighlight>
 +
 +
* switch
 +
<syntaxhighlight lang=bash>
 +
# "Física"
 +
ip link set eth0 up
 +
ip link set eth1 up
 +
ip link set eth2 up
 +
ip link set eth3 up
 +
#
 +
# Enlace: agregação de enlace
 +
modprobe bonding mode=4 lacp_rate=1 xmit_hash_policy=0 miimon=100
 +
ip link set bond0 up
 +
ifenslave bond0 eth0
 +
ifenslave bond0 eth1
 +
#
 +
# Enlace: VLAN
 +
ip link add link bond0 name bond0.10 type vlan id 10
 +
ip link set bond0.10 up
 +
ip link add link bond0 name bond0.20 type vlan id 20
 +
ip link set bond0.20 up
 +
#
 +
# Enlace: pontes
 +
brctl addbr br10
 +
ip link set br10 up
 +
btcrl addif br10 bond0.10
 +
brctl addif br10 eth3
 +
brctl addbr br20
 +
ip link set br20 up
 +
brctl addif br20 bond0.20
 +
brctl addif br20 eth2
 +
#
 +
# Enlace: STP
 +
#
 +
# Rede: endereçamento IPv4
 +
#
 +
# Rede: roteamento IPv4
 +
#
 +
# Rede: endereçamento IPv6
 +
#
 +
# Rede: roteamento IPv6
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Edição das 09h21min de 14 de outubro de 2014

URL encurtada: https://bit.ly/red20142

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.

Aulas

Plano de ensino

01/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.

Conceitos básicos

Leitura recomendada: capítulos 1, 2, 7 e 8 do livro base.[1]

05/08: revisão

  • Arquitetura de redes de computadores.

08/08: revisão

  • Netkit. Arquivo de exemplo utilizado em aula:

  1. Configurações globais

global[compact]=False global[mem]=64 global[vm]=4 global[clean]=False global[path]=/tmp/red20142/lab

  1. Equipamentos

A[type]=generic B[type]=generic R[type]=router

  1. Enlaces e endereçamento IPv4

A[eth0]=AR:ip=10.0.0.2/30 R[eth0]=AR:ip=10.0.0.1/30 R[eth1]=BR:ip=172.16.0.1/30 B[eth0]=BR:ip=172.16.0.2/30 </syntaxhighlight>

12/08: conceitos básicos

  • Transmissão orientada a bit e byte.
  • Transmissão analógica e digital, código de linha.
  • Topologias de redes físicas e lógicas.
  • Comutação por circuitos, datagramas e circuitos virtuais.
  • Multiplexação.

Projeto 1: Rede local em meio guiado

Leitura recomendada: capítulos 12, 13 e 15 livro base.

15/08: apresentação do projeto

A primeira rede:

  1. Configurações globais

global[compact]=False global[mem]=64 global[vm]=4 global[clean]=False global[path]=/tmp/red20142/lab

  1. Equipamentos

roteador0[type]=router switch0[type]=switch servidor0[type]=generic estacao0[type]=generic estacao1[type]=generic

  1. Enlaces

roteador0[eth0]=enlace0 switch0[eth0]=enlace0

servidor0[eth0]=enlace1 switch0[eth1]=enlace1

estacao0[eth0]=enlace2 switch0[eth2]=enlace2

estacao1[eth0]=enlace3 switch0[eth3]=enlace3 </syntaxhighlight>

19/08: Ethernet e CSMA/CD

  • Redes de múltiplo acesso
  • IEEE 802.3 e Ethernet
  • CSMA/CD

22/08: IEEE 802.1Q

  • VLAN.
  • Cenário com rede interna (etiqueta 100) e, agora, DMZ (etiqueta 200). No caso, somente o switch e o roteador precisam operar diretamente com IEEE 802.1q.

  1. Configurações globais

global[compact]=False global[mem]=64 global[vm]=4 global[clean]=False global[path]=/tmp/red20142/lab

  1. Equipamentos

roteador0[type]=router switch0[type]=switch servidor0[type]=generic estacao0[type]=generic estacao1[type]=generic dmz0[type]=generic

  1. Enlace e Rede (endereçamento)

roteador0[eth0]=enlace0:vlan_tagged=(100,ip=192.168.100.254/24),(200,ip=192.168.200.254/24) switch0[eth0]=enlace0:vlan_tagged=100,200

servidor0[eth0]=enlace1:ip=192.168.100.1/24 switch0[eth1]=enlace1:vlan_untagged=100

estacao0[eth0]=enlace2:ip=192.168.100.100/24 switch0[eth2]=enlace2:vlan_untagged=100

estacao1[eth0]=enlace3:ip=192.168.100.101/24 switch0[eth3]=enlace3:vlan_untagged=100

dmz0[eth0]=enlace4:ip=192.168.200.1/24 switch0[eth4]=enlace4:vlan_untagged=200

  1. Rede (roteamento)

servidor0[default_gateway]=192.168.100.254 estacao0[default_gateway]=192.168.100.254 estacao1[default_gateway]=192.168.100.254 dmz0[default_gateway]=192.168.200.254</syntaxhighlight>

26/08: IEEE 802.1Q

  • VLAN.

29/08: IEEE 802.1Q e IEEE 802.1P

  • Priorização de pacotes em redes locais, IEEE 802.1P.

No nosso cenário, por exemplo, é possível modificar a prioridade a partir de um dispositivo que manipule os cabeçalhos IEEE 802.1Q e IEEE 802.1P, como roteador. A seguir, os quadros destinados (operação set_egress_map) para a VLAN 200 (interface eth0.200) terão sua prioridade original (0) modificada para máxima (7):

vconfig set_egress_map eth0.200 0 7

No caso do Netkit, esse comando pode ser aplicado no arquivo .startup das máquinas virtuais roteador0 e switch0.

02/09: IEEE 802.1D-2004

  • STP.

05/09: IEEE 802.1D-2004

  • Laboratório com STP:

  1. Configurações globais

global[compact]=False global[mem]=64 global[vm]=4 global[clean]=False global[path]=/tmp/red20142/lab

  1. Equipamentos

roteador0[type]=router switch0[type]=switch switch0[stp]=on:bridge_priority=0 switch1[type]=switch switch1[stp]=on:bridge_priority=4096 switch2[type]=switch switch2[stp]=on:bridge_priority=8192 switch3[type]=switch switch3[stp]=on:bridge_priority=16384 servidor0[type]=generic estacao0[type]=generic estacao1[type]=generic

  1. Enlaces

roteador0[eth0]=enlace0 switch0[eth0]=enlace0

servidor0[eth0]=enlace1 switch1[eth0]=enlace1

estacao0[eth0]=enlace2 switch2[eth0]=enlace2

estacao1[eth0]=enlace3 switch3[eth0]=enlace3

  1. Entre switches

switch0[eth1]=enlace4 switch1[eth1]=enlace4 switch0[eth2]=enlace5 switch2[eth2]=enlace5 switch0[eth3]=enlace6 switch3[eth2]=enlace6 switch1[eth2]=enlace7 switch2[eth1]=enlace7 switch2[eth3]=enlace8 switch3[eth1]=enlace8 </syntaxhighlight>

Monitoramento individual das interfaces:

for x in 0 1 2 3; do (tcpdump -ni eth${x} -w /hostlab/$(hostname)-eth${x}.pcap &); done

09/09: IEEE 802.1D, 802.1w e 802.1s

  • IEEE 802.1D STP.
  • IEEE 802.1w RSTP.
  • IEEE 802.1s MSTP.

12/09: IEEE 802.3ad

  • Agragação de enlace.

16/09: finalização do projeto

  • lab.conf:
# Configurações globais
global[compact]=False
global[mem]=64
global[vm]=4
global[clean]=False
global[path]=/tmp/red20142/lab

# Equipamentos
roteador0[type]=generic
switch0[type]=generic

# Enlaces
roteador0[eth0]=roteador0-switch0-enlace0
switch0[eth0]=roteador0-switch0-enlace0

roteador0[eth1]=roteador0-switch0-enlace1
switch0[eth1]=roteador0-switch0-enlace1
  • /tmp/red20142/lab/roteador0.startup:
#!/bin/bash

/hostlab/roteador0-auto.sh

# LACP
modprobe bonding miimon=100 mode=4 lacp_rate=fast xmit_hash_policy=0
ifconfig bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
ip link set bond0 up

# STP
brctl addbr br0
brctl stp br0 on
brctl setbridgeprio br0 4096
brctl addif br0 bond0
ip link set br0 up

# VLAN
vconfig set_name_type VLAN_PLUS_VID_NO_PAD
vconfig add br0 100
vconfig add br0 200
ip link set vlan100 up
ip link set vlan200 up

# Rede
ip address add 192.168.100.1/24 dev vlan100
ip address add 192.168.200.1/24 dev vlan200
  • /tmp/red20142/lab/switch0.startup:
#!/bin/bash

/hostlab/switch0-auto.sh

# LACP
modprobe bonding miimon=100 mode=4 lacp_rate=fast xmit_hash_policy=0
ifconfig bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
ip link set bond0 up

# STP
brctl addbr br0
brctl stp br0 on
brctl setbridgeprio br0 0
brctl addif br0 bond0
ip link set br0 up

# VLAN
vconfig set_name_type VLAN_PLUS_VID_NO_PAD
vconfig add br0 100
vconfig add br0 200
ip link set vlan100 up
ip link set vlan200 up

19/09: entrega do projeto

Defesa do primeiro projeto da disciplina.

Projeto 2: Rede local em meio não guiado

Leitura recomendada: livro sobre o padrão IEEE 802.11.[2]

23/09: IEEE 802.11

  • Conceitos de IEEE 802.11.

26/09: IEEE 802.11

  • Conceitos de IEEE 802.11.

30/09: IEEE 802.11 e modo ad-hoc

  • Aula prática de configuração de rede em modo ad-hoc.

03/10: IEEE 802.11 e modo infraestrutura

  • Aula prática de configuração de rede em modo infraestrutura. Um exemplo de configuração da aplicação hostapd:

  1. Interfaces

interface=wlan1 bridge=br0 driver=nl80211

  1. SSID

ssid=abc ignore_broadcast_ssid=0

  1. Canais

channel=3 ieee80211n=0 </syntaxhighlight>

07/10

10/10

14/10: revisão para a prova

  • estacao1
# "Física"
ip link set eth0 up
#
# Enlace: agregação de enlace
#
# Enlace: VLAN
#
# Enlace: pontes
#
# Enlace: STP
#
# Rede: endereçamento IPv4
ip -4 address add 192.168.10.2/24 dev eth0
#
# Rede: roteamento IPv4
ip -4 route add 0.0.0.0/0 via 192.168.10.1
#
# Rede: endereçamento IPv6
ip -6 address add FC00:10::2/64 dev eth0
#
# Rede: roteamento IPv6
ip -6 route add ::/0 via FC00:10::1
  • estacao2
# "Física"
ip link set eth0 up
#
# Enlace: agregação de enlace
#
# Enlace: VLAN
#
# Enlace: pontes
#
# Enlace: STP
#
# Rede: endereçamento IPv4
ip -4 address add 192.168.20.2/24 dev eth0
#
# Rede: roteamento IPv4
ip -4 route add 0.0.0.0/0 via 192.168.20.1
#
# Rede: endereçamento IPv6
ip -6 address add FC00:20::2/64 dev eth0
#
# Rede: roteamento IPv6
ip -6 route add ::/0 via FC00:20::1
  • roteador
# "Física"
ip link set eth0 up
ip link set eth1 up
#
# Enlace: agregação de enlace
modprobe bonding mode=4 lacp_rate=1 xmit_hash_policy=0 miimon=100
ip link set bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
#
# Enlace: VLAN
ip link add link bond0 name bond0.10 type vlan id 10
ip link set bond0.10 up
ip link add link bond0 name bond0.20 type vlan id 20
ip link set bond0.20 up
#
# Enlace: pontes
#
# Enlace: STP
#
# Rede: endereçamento IPv4
ip -4 address add 192.168.10.1/24 dev bond0.10
ip -4 address add 192.168.20.1/24 dev bond0.20
#
# Rede: roteamento IPv4
sysctl -w net.ipv4.conf.all.forwarding=1
#
# Rede: endereçamento IPv6
ip -6 address add FC00:10::1/64 dev bond0.10
ip -6 address add FC00:20::1/64 dev bond0.20
#
# Rede: roteamento IPv6
sysctl -w net.ipv6.conf.all.forwarding=1
  • switch
# "Física"
ip link set eth0 up
ip link set eth1 up
ip link set eth2 up
ip link set eth3 up
#
# Enlace: agregação de enlace
modprobe bonding mode=4 lacp_rate=1 xmit_hash_policy=0 miimon=100
ip link set bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
#
# Enlace: VLAN
ip link add link bond0 name bond0.10 type vlan id 10
ip link set bond0.10 up
ip link add link bond0 name bond0.20 type vlan id 20
ip link set bond0.20 up
#
# Enlace: pontes
brctl addbr br10
ip link set br10 up
btcrl addif br10 bond0.10 
brctl addif br10 eth3
brctl addbr br20
ip link set br20 up
brctl addif br20 bond0.20
brctl addif br20 eth2
#
# Enlace: STP
#
# Rede: endereçamento IPv4
#
# Rede: roteamento IPv4
#
# Rede: endereçamento IPv6
#
# Rede: roteamento IPv6

Projeto 3: Redes de Circuitos Virtuais

  • Frame Relay
  • ATM, PPP, ADSL
  • MPLS

Projeto 4: Segurança

  • AAA
  • Chave compartilhada, chaves pública e privada
  • WEP, WPA e WPA2
  • IEEE 802.1X e EAP

Referências

  1. FOROUZAN, Berhouz. Comunicação de Dados e Redes de Computadores. ed. McGraw-Hill. 4a ed. 2008. ISBN 9788586804885.
  2. GAST, M. 802.11 Wireless Networks: The Definitive Guide. O'Reilly Media. 2ª ed. 2005.