Network Layer
202403192331
Status: #idea
Tags: CN
Network Layer
IP Address
- Associated with an interface
- Dotted-decimal format
- ICANN Provides a block of IP addresses
Subnets
- Devices in a subnet can communicate with each other without a router
Classless InterDomain Routing (CIDR)
a.b.c.d/x, whereis the number of bits in the network address of the subnet
Note
The rc file stores a static IP for a host UNIX host
Dynamic Host-Control Protocol (DHCP)
- Follows DORA (Discover, Offer, Request, Acknowledge)
- DHCP returns
- IP address and netmask
- Gateway address
- DNS server host name and IP address
- DHCP DISCOVER - Broadcast
src: 0.0.0.0, 68
dest: 255.255.255.255, 67
yiaddr: 0.0.0.0
Transaction ID: <randomly generated integer = 654>
- DHCP OFFER - Broadcast
src: <DHCP server IP>, 67
dest: 255.255.255.255, 68
yiaddr: <IP address offered to the client>
transaction ID: 654
lifetime: 3600 secs
- DHCP REQUEST - Broadcast
src: 0.0.0.0, 68
dest: 255.255.255.255, 67
yiaddr: <IP offered to the client>
transaction ID: 654
lifetime: 3600 sec
- DHCP ACK - Broadcast
src: <DHCP server IP>, 67
dest: 255.255.255.255, 68
yiaddr: <IP offered to the client>
transaction ID: 654
lifetime: 3600 sec
Warning
For the purpose of this course, do NOT take
Network Address Translation (NAT)
- Have a single IP address for a set of hosts
- Can be public-private or private-private
- NAT box maps one side to another
- Advantages:
- Less number of public IPs needed
- Abstraction/separation between public IP and private IPs
- Controversial
- Routers should only process upto layer 3, but sockets are in transport layer
- Violates end-to-end argument
- NAT possibility should be taken into account by application development
- Private IP ranges
10.0.0.0/24172.16.0.0/12192.168.0.0/16
NAT Table
Attention
Maps based on port number and IP.

Internet Control Message Protocol (ICMP)
- Used by hosts and routers to communicate network-level information
- Network-layer 'above' IP
- ICMP messages carried in IP datagrams
- ICMP message consists of
- Type
- Code
- First 8 bytes of the IP datagram, causing error (Part of the response)