0% found this document useful (0 votes)
21 views

Basic of 4 Network Layer - 1 Data Plane

The ARP protocol allows hosts and routers to dynamically map IP addresses to MAC addresses within a local area network (LAN). When a host wants to send data to another host on the same LAN but does not know its MAC address, it broadcasts an ARP request containing the target IP address. The target host responds with its MAC address. This address mapping is stored in the ARP cache of the requesting host for future use. ARP periodically refreshes address mappings to account for changes. This process allows hosts on a LAN to communicate using IP addresses while frames are delivered using MAC addresses at the data link layer.

Uploaded by

mesba Hoque
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Basic of 4 Network Layer - 1 Data Plane

The ARP protocol allows hosts and routers to dynamically map IP addresses to MAC addresses within a local area network (LAN). When a host wants to send data to another host on the same LAN but does not know its MAC address, it broadcasts an ARP request containing the target IP address. The target host responds with its MAC address. This address mapping is stored in the ARP cache of the requesting host for future use. ARP periodically refreshes address mappings to account for changes. This process allows hosts on a LAN to communicate using IP addresses while frames are delivered using MAC addresses at the data link layer.

Uploaded by

mesba Hoque
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

IP packet

IP packet

IP header IP payload

 IP packet contains a header and payload


Payload is the data want to send to the network
Header is processed by router and host
IP packet format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to options (if any)
data
(variable length,
typically a TCP
or UDP segment)
 Version(4 bits)
Value is 0100=4 , means IPv4

 Header length (4 bits)


Number of 32-bit(4-byte) words in the header
Typically “5” (for a 5*4-byte=20-byte IPv4 header)

 Total length (16 bits)


Number of bytes in the packet
16bits: 0-65535, so the maximum length of a IP
packet is 65536 Bytes
Telling end-host how to handle packet

 Protocol (8 bits)
Identifies the higher-level (Transport layer, TCP or
UDP)protocol
Important for receiving host, send the data in
received IP packet to which protocol in transport layer

L7 Application SMTP HTTP DNS NTP

L4 Transport TCP UDP

L3 Network IP

L2 Data link Ethernet FDDI PPP

L1 Physical Optical Copper Radio PSTN


Telling end-host how to handle packet

 Protocol (8 bits)
 examples
 E.g., “6” for the Transmission Control Protocol (TCP)
 E.g., “17” for the User Datagram Protocol (UDP)

protocol=6 protocol=17
IP header IP header
TCP header UDP header

5
Preventing loops (TTL)

 Forwarding loops cause packets to cycle for a long


time

 Time-to-Live (TTL) (8 bits,0-255)


TTL-1 at each hop(each router); packet discarded if TTL=0
Checksum

 Checksum (16 bits)


checksum of packet header
 If not correct, router discards packets
Fragmentation

 Every data link has a “Maximum Transmission Unit”


(MTU)
Largest number of bits it can carry in data link layer frame
 A router can split a packet into multiple “fragments”
if the IP packet size is large than the link’s MTU
MAC address vs. IP address

 MAC Address  IP Address


 Can not changed in our  Can be configured and
computer changed
 48 bits (e.g., 00-0E-9B-6E-  32 bits (e.g., 12.178.66.9 in
49-76 in hex) decimal)
 Used to forward frame  Used to forward IP packet to
between interfaces on destination IP subnet through
same network different networks
IP addressing: introduction
223.1.1.1
 IP address: 32-bit
identifier for host, router 223.1.2.1

interface 223.1.1.2
223.1.1.4 223.1.2.9
 interface: connection
between host/router and
physical link
223.1.3.27
223.1.1.3
223.1.2.2
• router’s typically have
multiple interfaces
• host typically has one or two
interfaces (e.g., wired 223.1.3.1 223.1.3.2

Ethernet, wireless 802.11)


 IP addresses associated
with each interface 223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1
Subnets

 IP address has two 223.1.1.1


parts:
• subnet part - high order 223.1.1.2 223.1.2.1
223.1.1.4 223.1.2.9
bits
• host part - low order bits 223.1.2.2
223.1.1.3 223.1.3.27
 what’s a subnet ?
• device interfaces with same subnet
subnet part
223.1.3.2
• can physically reach each 223.1.3.1
other without router
network consisting of 3 subnets

Note: High order = leftmost = most significant bits in an address!


Subnets
223.1.1.0/24
223.1.2.0/24
 to determine the 223.1.1.1
subnets, detach each subnet subnet
interface from its host 223.1.1.2 223.1.2.1
or router, creating 223.1.1.4 223.1.2.9
isolated networks
 each isolated network is 223.1.1.3 223.1.3.27
223.1.2.2

called a subnet
subnet

223.1.3.1 223.1.3.2

223.1.3.0/24
subnet mask: /24
Leftmost(most significant) X bits out of 32 bit defines the subnet address:
Here: 223.1.1.xxx 11011111.00000001.00000001.xxxxxxxx
Subnets 223.1.1.2

how many subnets are 223.1.1.1 223.1.1.4


shown in the diagram?
223.1.1.3

Hint:
consider subnet mask /24 (i.e. fix 223.1.9.2 223.1.7.0
first three bytes = 24 bits)
Answer:
6 subnets
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2


IP addressing: CIDR

CIDR: Classless InterDomain Routing


• subnet parts of address of arbitrary length
• IP address format: a.b.c.d/x, where x is
number of bits in subnet part of address
prefix host
subnet host
part part
11001000 00010111 00010000 00000000
In decimal : 200. 23. 16. 0/23

200. 23. 16. 0/23


IP Addressing
Subnet (network) mask : designates a subnetwork.

For example:
192.168.0.0 with mask
255.255.255.0 (in decimal)
11111111. 11111111. 11111111.00000000 (in binary)
(24 1s (means subnet part is 24 bits) and
8 0s (means host part is 8bits) )

Same as:
192.168.0.0/24 in CIDR notation,

/24 Means:
leftmost 24 bits is subnetwork part,
Other 32-24=8bits are hosts part, which means in this subnet
have 254 hosts(8 bits for host part, 28-2=256-2=254).
ARP: address resolution protocol
transfer IP address to MAC address
Question: how to determine
interface’s MAC address,
knowing its IP address? ARP table: each node (host,
router) on LAN has ARP table
137.196.7.78
• IP/MAC address
mappings for some LAN
1A-2F-BB-76-09-AD
nodes:
137.196.7.23
137.196.7.14
< IP address; MAC address; TTL>
• TTL (Time To Live):
LAN time after which address
71-65-F7-2B-08-53 mapping will be
58-23-D7-FA-20-B0
forgotten (typically 20
min)
0C-C4-11-6F-E3-98
137.196.7.88
How is ARP protocol working?

 Suppose host A and host B are in the same network, A wants to


send IP packet to B,but B’s MAC address not in A’s ARP table.
Then A use ARP protocol to get B’s MAC address.
(1) A broadcasts ARP query packet, containing B's IP address
• But destination MAC address is FF-FF-FF-FF-FF-FF, means all hosts
• Then all nodes on this network receive ARP query
(2) B receives ARP query packet, replies to A with its (B's) MAC
address by a frame sent to A
(3) A caches (saves) B’s IP-to-MAC address pair in its ARP table

You might also like