Escolar Documentos
Profissional Documentos
Cultura Documentos
IPv4
IP Datagram Format
IPv4 Addressing
ARP and RARP
IP Routing Basics
Subnetting and Supernetting
ICMP
Network Address Translation (NAT)
Dynamic Addressing
Oct 21, 2004 CS573: Network Protocols and Standards 2
0 8 16 24 32 bits
A 1.0.0.0 126.0.0.0
B 128.0.0.0 191.255.0.0
C 192.0.0.0 223.255.255.0
D 224.0.0.0 239.255.255.255
E 240.0.0.0 247.255.255.255
Uniqueness of IP Addresses
Network numbers are assigned by a central authority
The Internet Network Information Center (InterNIC)
Another authority, the IANA – Internet Assigned Numbers
Authority sets policy
Network numbers are unique worldwide
Host numbers are assigned by network managers
They must be unique within a given network
Thus, IP addresses are unique worldwide.
Internet Addresses
ALL 0’s This Host
More on ARP
ARP refinements
Source includes its <IP address, physical address> mapping in the
ARP request anticipating the target’s need for it in the near future.
This avoids extra network traffic
When all machines receive the ARP request broadcast, they can
store the address mapping in their cache. Do they?
ARP is used when an IP to physical address mapping changes to
notify hosts on the network of the change
ARP messages are encapsulated in MAC frames. A special value
in the type field of the frame is used to indicate that it is
carrying an ARP message (0806 hex is used for ARP)
Entries in the local ARP cache for each host time out after a
certain period
0 8 16 24 31
HARDWARE TYPE PROTOCOL TYPE
HLEN PLEN OPERATION
SENDER HA (octets 0-3)
SENDER HA (octetS 4-5) SENDER IP (octetS 0-1)
SENDER IP (octetS 2-3) TARGET HA (octets 0-1)
TARGET HA (octets 2-5)
TARGET IP (octets 0-3)
ARP Message
HARDWARE TYPE: specifies type of hardware interface for
which the request is made (e.g., 1 for Ethernet)
PROTOCOL TYPE: specifies high level protocol address supplied
in message (e.g. 0800 hex for IP)
HLEN and PLEN: specify length of fields for hardware address
and protocol address respectively
OPERATION: specifies if this is an ARP request or reply message
(1 for ARP request, 2 for ARP response, 3 for RARP request and
4 for RARP response)
HA and IP: hardware and IP addresses respectively
Reverse ARP
Usually, a machine’s IP address is kept on its
secondary storage (OS finds it at start up)
Issue : Diskless Workstations!
files are stored on a remote server
need IP address to use TCP/IP to obtain initial boot image
Solution : Use physical address to identify machine
Given a physical network address, find the
corresponding Internet address
Reverse Address Resolution Protocol (RARP), RFC903
RARP
Mechanism
Sender broadcasts a RARP request, supplying its physical
network address in the Target HA field
Only machines authorized to supply the RARP service (RARP
servers) process the request and send a reply filling in the
target internet address
Mechanism allows a host to ask about an arbitrary
target
thus sender HA is separate from target HA address
RARP server replies to sender’s HA
Ethernet frame Protocol Type for RARP is 8035 hex
IP Routing
Routing IP Datagram
Direct Delivery (i.e., not involving routers):
Transmission of an IP datagram between two machines on a
single physical network does not involve routers
The sender encapsulates the datagram in a physical frame,
binds the destination IP address to a physical hardware
address (using ARP), and sends the resulting frame directly
to the destination
The two machines are known to be on the same network
because they have the same network identifier
Router
Example:
A sends IP Datagram to B
A B C
Routing IP Datagram
Indirect delivery (i.e. through intermediate
routers)
Host performs routing decisions based on routing
table indicating “next hop”
“Next hop” refers to next router IP address on this
network, via which the destination is reached
Routing decisions are made based on network
prefixes (not full IP address)
The sender encapsulates the datagram in a frame
with the router’s physical destination address
(which is found by means of ARP).
Host A
204.240.18.10
204.240.18.1
Direct Routing:
Packets sent directly using
Router Internet
MAC address of A
Indirect Routing:
Packets sent to the MAC address
Host B of the router. At the IP level, B is
204.240.18.20 The source and C is the destination
Host C
36.14.0.200
IP Routing Decisions
10.0.0.5 40.0.0.7
20.0.0.6 30.0.0.6
Network 20.0.0.5
10.0.0.0 R3
R1 Network Network Network
20.0.0.0 R2 30.0.0.0 40.0.0.0
30.0.0.7
Routing Table of R2
To Reach Hosts on Network Next Hop Address
20.0.0.0 Direct Delivery
30.0.0.0 Direct Delivery
10.0.0.0 20.0.0.5
40.0.0.0 30.0.0.7
IP Routing Algorithm
Router receives an IP datagram with network portion N and
destination D
If N is directly connected
Transmit on that network
Else
Declare error
Proxy ARP
Main Router
To Internet Main Network
A B C
Router R
D E
Hidden Network
Proxy ARP
Advantage of Proxy ARP Router
Can be added without disturbing the routing table in other
hosts or routers on that network
Disadvantages:
Does not generalize to complex network topologies (does
not scale)
Does not support a reasonable form of routing. (relies on
network managers to maintain tables of machines and
addresses manually)
Issues:
Several IP addresses map to the same physical address.
How to distinguish between a legitimate Proxy ARP router
and spoofing?