Lecture 9 - Addressing, ARP, RARP, ICMP, DHCP
Lecture 9 - Addressing, ARP, RARP, ICMP, DHCP
Lecture 9 - Addressing, ARP, RARP, ICMP, DHCP
of EEE
Addressing
..contd
..contd
• Internet Address – IP Address The difference between classful IP
– Classful addressing – original architecture addressing and classless IP addressing
• Class A, B, C, D, and E
– Classless addressing – introduced during mid
• is in selecting the number of bits used for the
1990s
network ID portion of an IP address. In classful
• IPv4
IP addressing, the network ID portion can take
– 32-bit binary number
only the predefined number of bits 8, 16, or 24.
In classless addressing, any number of bits
can be assigned to the network ID.
– Dotted-Decimal Notation
128.11.3.31
255.255.255.0
• IPv6 - 128-bit
3 4
Prepared by S.Muralidharan 1
CS65-Computer Networks Dept. of EEE
..contd
..contd .. contd
5 6
Addressing – IPV4
Netid and Hostid • Network ID, Host ID
• Class A – 128 blocks (First Byte), 16,777,216 hosts
• Class B – 16,384 blocks (First & Second Byte), 65536 hosts
• Class C – 2,097,152 blocks (First, Second, Third byte), 256 hosts
• Class D – 1 block, Multicasting
7 8
Prepared by S.Muralidharan 2
CS65-Computer Networks Dept. of EEE
9 10
11 12
Prepared by S.Muralidharan 3
CS65-Computer Networks Dept. of EEE
13 14
15 16
Prepared by S.Muralidharan 4
CS65-Computer Networks Dept. of EEE
Class A
17 18
19 20
Prepared by S.Muralidharan 5
CS65-Computer Networks Dept. of EEE
21 22
…contd
router
• An organization can subdivide it’s host address
space into groups called subnets.
• The subnet ID is generally used to group hosts Subnet 1 Subnet 2 Subnet 3
based on the physical network topology. 128.213.1.x 128.213.2.x 128.213.3.x
• Subnet masks define variable partition of host
part
• Subnets visible only within site
23 24
Prepared by S.Muralidharan 6
CS65-Computer Networks Dept. of EEE
An Institutional network
mail server
to external
network
router web server
switch
IP subnet
hub
hub hub
25 26
Prepared by S.Muralidharan 7
CS65-Computer Networks Dept. of EEE
27 26 25 24 23 22 21 20
A Network With and Without
128 64 32 16 8 4 2 1
Subnetting
140.192.56.45
140 192 56 45
IP Address
1 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1
Network Subnet Host
255 255 255 0
NetMask
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
140 192 56 0
Network Address
1 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0
140.192.56.0/24
24-bit mask
8-bit subnet mask
140.192.56.45
140 192 56 45
IP Address
1 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1
Network Subnet Host
255 255 240 0
NetMask
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
140 192 48 0
Network Address
1 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
140.192.48.0/20
20-bit mask
4-bit subnet mask
29 30
Prepared by S.Muralidharan 8
CS65-Computer Networks Dept. of EEE
33 34
Prepared by S.Muralidharan 9
CS65-Computer Networks Dept. of EEE
ARP operation
• ‘A’ wants to send datagram to ‘B’, and 'A' knows ‘B’s’ IP address.
• Suppose 'B'’s MAC address is not in ‘A’s’ ARP table.
• 'A' broadcasts ARP query packet, containing 'B’s’ IP address
– all machines on LAN receive ARP query
• 'B' receives ARP packet, replies to 'A' with its (‘B’s’) MAC address
– frame sent to ‘A’s’ MAC address (unicast)
• 'A' caches (saves) IP-to-MAC address pair in its ARP table until
information becomes old (times out)
– soft state: information that times out (goes away) unless
refreshed
• ARP is “plug-and-play”:
– nodes create their ARP tables without intervention from net
administrator
39 40
Prepared by S.Muralidharan 10
CS65-Computer Networks Dept. of EEE
R
not me B
• R removes IP datagram from Ethernet frame, sees its destined A 1-byte Protocol
Protocol--Length field specifying the length of the target protocol address (4 for IP).
to B A 16-bit Operation Code field specifying the operation desired (e.g., 1 for REQUEST or 0 for
RESPONSE).
• R uses ARP to get B’s MAC address
The sender's Ethernet address (Sender
• R creates frame containing A-to-B IP datagram sends to B Hardware Address) (if known).
43 44
Prepared by S.Muralidharan 11
CS65-Computer Networks Dept. of EEE
RARP
ARP Details
45 46
Transport
TCP/UDP
not me
ICMP
Hi Red ! Your IP address is 128.213.1.17.
IP
47 48
Prepared by S.Muralidharan 12
CS65-Computer Networks Dept. of EEE
49 50
51 52
Prepared by S.Muralidharan 13
CS65-Computer Networks Dept. of EEE
55 56
Prepared by S.Muralidharan 14