Prof. Alfio Lombardo LA RISOLUZIONE DEGLI INDIRIZZI NELL’ARCHITETTURA TCP/IP
Jan 14, 2016
Prof. Alfio Lombardo
LA RISOLUZIONE DEGLI INDIRIZZI NELL’ARCHITETTURA TCP/IP
Indirizzo logico (livello applicativo)
Indirizzo di porta locale (livello di trasporto)
Indirizzo di host (livello di rete)
Indirizzo hardware (livello di linea)
Indirizzi nell’ architettura TCP/IP
LA RISOLUZIONE DEGLI INDIRIZZI
NELL’ARCHITETTURA TCP/IP
Risoluzione degli indirizzi del sistema chiamato
Risoluzione dell’indirizzo di host del sistema chiamante
Indirizzo logico (livello applicativo)
Risoluzione degli indirizzi del sistema chiamato
Indirizzo di host (livello di rete)
Indirizzo hardware (livello di linea)
Indirizzo di porta locale (livello di trasporto)
Esempio di indirizzo logico: ftp.sun90.cdc.unict.it
Esempio di indirizzo di host (IP): 192.5.48.7
Esempio di indirizzo di porta locale (TCP/UDP): 21
Esempio di indirizzo hardware (Ethernet): 00 9A 87 44 B8 C2
Indirizzamento IP
A
B
C
D
E
Internet: quanti indirizzi?
Indirizzi di tipo A: (0.0.0.0 - 127.255.255.255)
126 reti con 16 milioni di host ciascuna
Indirizzi di tipo B: (128.0.0.0 - 191.255.255.255)16382 reti con oltre 64000 hostsciascuna.
Indirizzi di tipo C: (192.0.0.0 - 223.255.255.255)
2 milioni di reti con più di 256 hosts
L’indirizzo IP:
10000000 00000011 00000010 00000011
Classe B rappresentato come 128.3.2.3
I network numbers vengono assegnati dal Network Information Center (NIC) per evitare conflitti.
Esempio
Esempio
R
128.10.2.8 128.10.2.26
host host
192.5.48.1
192.5.48.6
RTokenRing
192.5.48.0
Ethernet 128.10.0.0
128.10.2.3Multi homed
host
host
192.5.48.7
128.10.2.70
192.5.48.3
Indirizzo logico
Indirizzo di host
Domain Name System(DNS)
Il DNS espleta due funzioni concettualmente indipendenti:
specifica della sintassi dei nomi logici e delle regole per delegare l'autorità sui nomi stessi (funzione astratta); implementazione di un sistema distribuito di database che mappa in modo efficiente i nomi logici negli indirizzi di rete (funzione concreta).
Funzioni del DNS
int comedu
govmil
orgnet
jpnl
itus
mitunict
dieei
pclombardo
Esercizio consigliato:
DNS
151.97.6.5
yale
cs eng
pcsmith
Pclombardo.iit.unict.it ??
Applicazione Resolver
TCP/UDP
IP
Network interface Richiesta Al DNS ServerLocale
Procedura per la risoluzione dei nomi
Risoluzione dei nomi con modalitànon ricorsiva
Caching
Memoria cache Memoria cache
Rispostaunauthoritative
Rispostaauthoritative
Rispostaauthoritative
Indirizzo di host
Indirizzo hardware
Address Resolution Protocol(ARP)
E1151.97.6.1
E2151.97.6.2
E3151.97.6.3
E4151.97.6.4
A B C D
Address Resolution Protocol
E1 E_broadcast 151.97.6.1 151.97.6.3 E1E1 E3 151.97.6.1 151.97.6.3 E1 E3
Forwarding diretto: esempio
Subnet 192.168.10.0
MAC-D 000060AD8744MAC-S 00082C785852IP-D 192.168.10.35IP-S 192.168.10.10
MAC-D 000060AD8744MAC-S 00082C785852IP-D 192.168.10.35IP-S 192.168.10.10
MAC 00082C785852 MAC 000060AD8744
192.168.10.35192.168.10.10
ARP procedure
Forwarding indiretto: esempioProxi ARP
Subnet 192.168.10.0 Subnet 192.168.11.0.10 .1 .1 .90
MAC 00082C785852 MAC 00000C87654A MAC 00000CAB22A7 MAC 009A8744B8C2
Default Gateway192.168.10.1
Default Gateway192.168.10.1
Default Gateway192.168.11.1
Default Gateway192.168.11.1
MAC-D 00000C87654AMAC-S 00082C785852IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 00000C87654AMAC-S 00082C785852IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 009A8744B8C2MAC-S 00000CAB22A7IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 009A8744B8C2MAC-S 00000CAB22A7IP-D 192.168.11.90IP-S 192.168.10.10
ARP procedure ARP procedure
Forwarding indiretto: esempio
Subnet 192.168.10.0 Subnet 192.168.11.0.10 .1 .1 .90
MAC 00082C785852 MAC 00000C87654A MAC 00000CAB22A7 MAC 009A8744B8C2
Default Gateway192.168.10.1
Default Gateway192.168.10.1
Default Gateway192.168.11.1
Default Gateway192.168.11.1
MAC-D 00000C87654AMAC-S 00082C785852IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 00000C87654AMAC-S 00082C785852IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 009A8744B8C2MAC-S 00000CAB22A7IP-D 192.168.11.90IP-S 192.168.10.10
MAC-D 009A8744B8C2MAC-S 00000CAB22A7IP-D 192.168.11.90IP-S 192.168.10.10
ARP procedure
Address Resolution Protocol (Reverse Address Resolution Protocol)
ARP e trama data linK
MR 125
hardtype
protsize
hardsize
prottype
operationsender
Ethernet Addresssender
IP Address
targetEthernet Address
targetIP Address
2 12 1 2 6 4
INFOHEADER FCS
ARP: formato della trama
Entita’ IP Entita’ ARP Entita’ RARP
Interfaccia
(demux)
Trame in arrivoEsercizio consigliato:
ARP
Indirizzamento TCP
Port number– identificativo di un
utente TCP (programmi applicativi e/o utenti che fanno uso di uno stesso host)
– è rappresentato da un intero
Appl. 1Appl. 1 Appl. 2Appl. 2 Appl. nAppl. n
TCPTCP
IPIP
Network InterfaceNetwork Interface
• • •
Indirizzamento TCP
• L’assegnazione del numero di porta può essere– statico
• sono identificativi staticamente associati ad applicazioni largamente utilizzate
• sono utilizzati identificativi inferiori a 256
– dinamico• sono identificativi assegnati direttamente dal sistema operativo
al momento dell’apertura della connessione
Numero Numero7 37
21 5323 10325
ApplicazioneEcho
FTP (File Transfer Protocol)TELNET
SMTP (Simple Mail Transport Protocol 119
ApplicazioneTime
Domain Name ServerX400 Mail Service
NNTP (USENET New Transfer Prot.)
Servizio Porta TCP UDP
FTP 21 4Telnet 23 4SMTP 25 4TFTP 69 4DNS 53 4 4HTTP 80 4POP 109 4SNMP 161 4
Well Known Port
ProcessServer
User
TSAP
(a)
Host 1 Host 2
Time
Server
ProcessServer
Host 2
User
Host 1
(b)
User
TSAP
(a)
Host 1
User
Host 1
(b)
NameServer
Host 2
Time
Server
NameServer
Host 2
Time
Server
Risoluzione dell’indirizzo di host
del sistema chiamante
Necessaria per tutti quei sistemi che non conoscono il proprio IP address
Disklesssystems
Assegnazione dinamicadell’indirizzo IP
Problems a diskless computer faces during system startup:
The startup program (in ROM) does not contain
• IP address
• Bootstap program
• The file server address
• The nearest IP router address
Indirizzo di host
RARP,BOOTP,DHCP
Indirizzo hardware
Reverse Address Resolution Protocol (Address Resolution Protocol)
RARP related problems
• RARP operates at a low level
• The RARP replay contains the IP address only
• RARP cannot be used when address is dynamically assigned
BOOTP
DHCP
RFC 951 : Bootstrap Protocol (BOOTP)
A client/server based protocol allowing for bootstrapping
BOOTPclient
BOOTPserver
UDP68
UDP67
BOOTP uses UDP
BOOTP Server is implemented as an Application program
A single BOOTP message specifies many items
BUT…...
UDP uses IP!!
Using IP to determine IP address
• BOOTP Client uses Limited broadcast (destinazione=255.255.255.255)(sorgente= 0.0.0.0)
• BOOTP Server uses Limited broadcast too for its replay
BOOTP client has to use a well known port number (68)to avoid different clients using the same OS assigned port number receive the server response
BOOTP Protocol
• Require UDP checksum
• Require Dont Fragment bit setting
• Uses timeout and retransmission
Random delayRandom timeoutDouble timeout after retrasmission
Bootstrap Procedure
TFTP is used to obtain the memory image from the server
BOOTP Server provides client with informationneeded to obtain the memory image
BOOTP Message
OP=request, replayHtype=Hardware t.Hlen=HardAddr len.Hops= 0Trans.Id=IntegerSec=sec. since boot
IP router
BOOTP Server
Why Dynamic Configuration
Why Dynamic Configuration
IP router
BOOTP Server
LAN 1
LAN 2
Dynamic Host Configuration Protocol
• Allows a computer to acquire all the configuration information it needs in a single message
• Allows a computer to obtain an IP address dynamically
• DHCP Server has to be configured with a number of IP addresses
Address Assignement Types
• Manual Configuration
• Automatic Configuration
• Dynamic Configuration
Manager chooses how DHCP will response for each netand for each host (like BOOTP, DHCP uses the hardware address as client identifier)
Static assignment db
Dynamic assignment db
client serverUDP67
client UDP68
client UDP68
client UDP68
client UDP68
client UDP68
client UDP68
client UDP68
client UDP68
server
server
server
server
server
server
server
server
UDP67
UDP67
UDP67
UDP67
UDP67
UDP67
UDP67
UDP67
DHCP Discover
DHCP Offer
DHCP Request
DHCP Ack
DHCP Request
DHCP Request
DHCP Ack/Nack
DHCP Release
T=50%
T=85%
…………
Passive open
DHCP Protocol
DHCP Message
flag unused