Escolar Documentos
Profissional Documentos
Cultura Documentos
Protocolos de Controlo
Histórico
V1.0, Paula Viana, 1999
V2.0, Paula Viana, 2004
v2.1, Paula Viana, 2005
v2.2, Paula Viana, 2006
ISEP
Protocolos de Controlo
Protocolos de Controlo
ICMP - Internet Control Message Protocol
• reporta erros
• mensagem encapsulada num pacote IP (não fiável!)
• IP TOS = 0
• IP Protocol = 1
• 1º byte do campo de dados identifica tipo de mensagem ICMP
• Formato da mensagem ICMP depende do tipo de mensagem
• RFC 792
ARP - Address Resolution Protocol
• RFC 826
• Mensagem encapsulada numa trama Ethernet (tipo de trama = 0x0806)
RARP - Reverse Address Resolution Protocol
• RFC 903
ISEP
Protocolos de Controlo
Soluções:
Tabela de conversão de endereços!
ARP Request/Reply
TCP/IP Protocol Suite
ISEP
Protocolos de Controlo
ARP Examples
* Note: The length of the address fields is determined by the corresponding address length fields
Operation Code: Request = 1 : Reply = 2
ISEP
Protocolos de Controlo
ARP Frame
ARP Request
1. ARP Request is enclosed in an Ethernet frame
with destination address ff:ff:ff:ff:ff:ff (and source
its own Ethernet address)
2. All hosts on the local network read the frame
3. The target host recognises the request for its IP
address and Replies.
ISEP
Protocolos de Controlo
ARP Reply
1. The addressed host (target) knows the source's
Ethernet address as read from the request
packet.
2. The target sends an ARP Reply containing its
own Ethernet address to the source host.
3. Other hosts do nothing.
4. Target The source gets the reply and reads out
the target's Ethernet address
5. It can now use that Ethernet address to send IP
packets
ARP Example
ISEP
Protocolos de Controlo
ARP Cache
Sending ARP requests for every outgoing packet
and waiting for responses is inefficient
Requires bandwidth
Consumes Time
Solution:
ARP cache maintained at each node
Size limit = 512 entries
ARP Cache
When ARP receives a MAC address, it is placed in
a cache.
When the next request comes in for the same IP
address, the entry in cache is used
Cache entries are associated with a validation time.
ISEP
Protocolos de Controlo
Proxy ARP
Responds to ARP Requests that arrives from one of its
connected networks for a host that is on another of its connected
networks.
Request
ARP Bridging
ISEP
Protocolos de Controlo
Defenses
Static ARP table
ARP snooping (Monitor the network for ARP uses).
Detection: Arpwatch (sending email when updates occur),
Legitimate use
Redirect a user to a registration page before allow usage of the network.
…
ARP Command
To display ARP table
arp -a
To delete entry
arp -d 192.168.1.2
ISEP
Protocolos de Controlo
Modo de Operação
• Broadcast de uma mensagem RARP com o endereço MAC de origem
• Obriga a existência de 1 servidor de RARP
• Resposta do tipo Unicast
• Após recepção de resposta, endereço IP é registado em memória
Encapsulamento
• Mensagem RARP é encapsulada numa trama MAC
• Ethernet: type 0x8035
Alternativas
BOOTP e DHCP
• semelhante a RARP mas o servidor pode estar noutra rede (mensagens são enviadas através de routers)
ISEP
Protocolos de Controlo
BOOTP
BOOTstrap Protocol (BOOTP)
• From 1985
• Host can configure its IP parameters at boot time.
• 3 services.
• IP address assignment.
• Detection of the IP address for a serving machine.
• The name of a file to be loaded and executed by the client machine
(boot file name)
Not only assign IP address, but also default router, network mask, etc.
Sent as UDP messages (UDP Port 67 (server) and 68 (host))
Use limited broadcast address (255.255.255.255):
• These addresses are never forwarded
22
ISEP
Protocolos de Controlo
Destination unreachable
• router não consegue encontrar o destino
• Ex: Df = 1 e uma rede de “pacotes pequenos” é encontrada
Time exceeded - Time to Live = 0
• Routers mal configurados - pacotes em loop
• congestionamento na rede
• valores de TTL demasiado pequenos
Parameter problem - campo do cabeçalho inválido
• erro no software (emissor ou router)
Source quench
• enviada a máquinas que estão a gerar muito tráfego (máquina deverá
diminuir o nº de pacotes que injecta na rede) aumenta tráfego!!!!
controlo de congestionamento no nível de transporte
ISEP
Protocolos de Controlo
Redirect
• router verifica que rota usada para transmitir 1 pacote não é a melhor!
ISEP
Protocolos de Controlo
Ping - Implementação
Ping - Exemplo
sun % ping -s svr4 (máquinas na mesma rede)
PING svr4 (140.252.13.34): 56 data bytes
64 bytes from svr4 (140.252.13,34): icmp_seq=0. time=7.ms
1º tempo superior aos outros...
64 bytes from svr4 (140.252.13.34): icmp_seq=1. time=4.ms (porquê)
64 bytes from svr4 (140.252.13.34): icmp_seq=2. time=4.ms
64 bytes from svr4 (140.252.13.34): icmp_seq=3. time=4.ms
---svr4 PING Statistics---
4 packets transmitted, 4 packets received, 0% packet loss, round-trip (ms) min/avg/max = 4/4/7
ISEP
Protocolos de Controlo
Bibligrafia Recomendada
William Stallings, Data and Computer Communications,
7th Edition, Prentice Hall, Chapter 18 - Internet Protocols
Richard Stevens, TCP/IP illustrated Volume I: The protocols
Andrew S. Tanembaum, Computer Networks, 3rd Edition,
Prentice Hall, Chapter 5.54
ISEP