CS 31204: Computer Networks – Moving From End-to-End To Per Hop
INDIAN INSTITUTE OF TECHNOLOGY
KHARAGPUR
Department of Computer Science and Engineering
Abhijnan Chakraborty
What We Have Learnt So Far …
Physical
Physical
Data Link
Physical
Data Link
Network
Physical
Data Link
Network
Transport
Indian Institute of Technology Kharagpur
What We Have Learnt So Far …
Software, Kernel
Firmware, Device Driver
Hardware
Physical
Data Link
Network
Transport
Application
Indian Institute of Technology Kharagpur
Network (Internet) Layer Services
UDP
End to end packet delivery
TCP
Connection Establishment
Reliable Data Delivery
Flow and Congestion Control
Ordered Packet Delivery
Transport
Data Link
Network
Addressing
Routing
Datagram delivery (unreliable)
Indian Institute of Technology Kharagpur
Internet Architecture – Basic Principles
SW Lab 1
SW Lab 2
Router
CSE Network
Indian Institute of Technology Kharagpur
Internet Architecture – Basic Principles
CSE Network
EEE Network
SW Lab 1
SW Lab 2
EE Lab 1
EE Lab 2
IITKGP Network
Indian Institute of Technology Kharagpur
Internet Architecture – Basic Principles
IITKGP Network
IITBBS Network
EEE
CSE
EEE
CSE
ERNET Network
Indian Institute of Technology Kharagpur
Internet Architecture – Basic Principles
BSNL Network
IITKGP
IITBBS
BSNL Public
BSNL Corporate
Bharti Airtel Network
ERNET Network
Indian Institute of Technology Kharagpur
Internet Architecture
Autonomous Systems (AS) – A set of LANs for an administrative domain, identified by a unique AS number, and the routing policies are controlled by a single administrator.
Local Area Network (LAN) – A set of devices with a common layer 3 gateway
Indian Institute of Technology Kharagpur
Autonomous System Graph for India
Source: https://rex.apnic.net/welcome
Indian Institute of Technology Kharagpur
Internet Architecture
Internet Service Providers (ISP) – An AS provides Internet connectivity to another group of ASes or end users
Indian Institute of Technology Kharagpur
Peering between ISPs
Indian Institute of Technology Kharagpur
Communication between Two Nodes over ISPs
Indian Institute of Technology Kharagpur
IP Addressing – Basic Principles
AS 10
AS 11
AS 13
AS 12
Host 1
Host 2
Indian Institute of Technology Kharagpur
IP Addressing – Basic Principles
AS 10
AS 11
AS 13
AS 12
Host 1
Host 2
Indian Institute of Technology Kharagpur
IP Addressing
Network address
Host address
Indian Institute of Technology Kharagpur
Classful Addressing
Indian Institute of Technology Kharagpur
Network Address and Broadcast Address
Indian Institute of Technology Kharagpur
Subnetting and Supernetting – Classless Inter-domain Routing (CIDR)
Indian Institute of Technology Kharagpur
Divide a Network into Subnets
Indian Institute of Technology Kharagpur
CIDR – Addressing Format
Host Address
Subnet Address
10111111
10110100
01010011
11101011
11111111
11110000
00000000
00000000
IP Address
Netmask
Indian Institute of Technology Kharagpur
CIDR - Manual IP Setting in the OS
Indian Institute of Technology Kharagpur
Divide a Network into Subnets
Indian Institute of Technology Kharagpur
All Zero and All One Subnets
192.168.0.0/16
192.168.0.0/17
192.168.128.0/17
192.168.0XXXXXXX.X
192.168.1XXXXXXX.X
The network address for the �subnet and the original network�is identical – Subnet Zero
Broadcast address for this subnet�is 192.168.255.255, broadcast�address for the original network�is also 192.168.255.255 – All-One�Subnet
We normally avoid “all zero” and “all one” subnets.
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 2000 Hosts
VGSOM – 500 Hosts
EE – 500 Hosts
203.110.0.0/19
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 2000 Hosts
VGSOM – 500 Hosts
EE – 500 Hosts
203.110.0.0/19
11 bit hosts
9 bit hosts
9 bit hosts
Indian Institute of Technology Kharagpur
CIDR Example
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 2000 Hosts
VGSOM – 500 Hosts
EE – 500 Hosts
203.110.0.0/19
11 bit hosts
9 bit hosts
9 bit hosts
10 bit hosts
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 11 bits, VGSOM+EE – 10 bits
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 2000 Hosts
VGSOM – 500 Hosts
EE – 500 Hosts
203.110.0.0/19
11 bit hosts
9 bit hosts
9 bit hosts
10 bit hosts
203.110.16.0/21
203.110.8.0/21
Indian Institute of Technology Kharagpur
CIDR Example
VGSOM – 9 bits, EE – 9 bits
Indian Institute of Technology Kharagpur
CIDR Example
CSE – 2000 Hosts
VGSOM – 500 Hosts
EE – 500 Hosts
203.110.0.0/19
11 bit hosts
9 bit hosts
9 bit hosts
10 bit hosts
203.110.16.0/21
203.110.8.0/21
203.110.12.0/23
203.110.10.0/23
Indian Institute of Technology Kharagpur
CIDR – Routing Table Construction
10.0.2.0/24
10.0.3.0/24
10.0.4.0/24
R1
R2
R3
eth0
eth1
10.0.2.1/24
10.0.3.1/24
10.0.4.1/24
172.16.1.1/24
172.16.1.2/24
172.16.2.1/24
172.16.2.2/24
Network | Netmask | Gateway | Interface |
10.0.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
10.0.3.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
10.0.4.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
0.0.0.0 | 0.0.0.0 | 172.16.1.1 | eth0 |
172.16.1.0 | 255.255.255.0 | 172.16.1.1 | eth0 |
172.16.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
Routing Table for R1
Indian Institute of Technology Kharagpur
CIDR – Routing Table Construction
10.0.2.0/24
10.0.3.0/24
10.0.4.0/24
R1
R2
R3
eth0
eth1
10.0.2.1/24
10.0.3.1/24
10.0.4.1/24
172.16.1.1/24
172.16.1.2/24
172.16.2.1/24
172.16.2.2/24
Network | Netmask | Gateway | Interface |
10.0.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
10.0.3.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
10.0.4.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
0.0.0.0 | 0.0.0.0 | 172.16.1.1 | eth0 |
172.16.1.0 | 255.255.255.0 | 172.16.1.1 | eth0 |
172.16.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
Routing Table for R1
Compaction of routing table is possible
Indian Institute of Technology Kharagpur
CIDR – Routing Table Construction
10.0.2.0/24
10.0.3.0/24
10.0.4.0/24
R1
R2
R3
eth0
eth1
10.0.2.1/24
10.0.3.1/24
10.0.4.1/24
172.16.1.1/24
172.16.1.2/24
172.16.2.1/24
172.16.2.2/24
Network | Netmask | Gateway | Interface |
10.0.0.0 | 255.255.0.0 | 172.16.2.2 | eth1 |
0.0.0.0 | 0.0.0.0 | 172.16.1.1 | eth0 |
172.16.1.0 | 255.255.255.0 | 172.16.1.1 | eth0 |
172.16.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
Compact
Routing Table for R1
Indian Institute of Technology Kharagpur
CIDR – Problem of Multihoming
10.0.2.0/24
10.0.3.0/24
10.0.4.0/24
R1
R2
R3
eth0
eth1
10.0.2.1/24
10.0.3.1/24
10.0.4.1/24
172.16.1.1/24
172.16.1.2/24
172.16.2.1/24
172.16.2.2/24
eth2
172.16.3.1/24
172.16.3.2/24
10.0.4.2/24
Indian Institute of Technology Kharagpur
CIDR – Longest Prefix Match
Network | Netmask | Gateway | Interface |
10.0.0.0 | 255.255.0.0 | 172.16.2.2 | eth1 |
10.0.4.0 | 255.255.255.0 | 172.16.3.2 | eth2 |
0.0.0.0 | 0.0.0.0 | 172.16.1.1 | eth0 |
172.16.1.0 | 255.255.255.0 | 172.16.1.1 | eth0 |
172.16.2.0 | 255.255.255.0 | 172.16.2.2 | eth1 |
Supernetting is not always perfect !
There is always a possibility of duplicate entries
Where to forward 10.0.4.8 ?
Indian Institute of Technology Kharagpur
Longest Prefix Matching
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
Longest Prefix Match
Destination Address Range
11001000 00010111 00010
11001000 00010111 00011000
11001000 00010111 00011
otherwise
Link interface
eth0
eth1
eth2
eth3
********
***
********
***
********
11001000 00010111 00011000 10101010
examples:
which interface?
which interface?
11001000 00010111 00010110 10100001
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
Longest Prefix Matching
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
Longest Prefix Match
Destination Address Range
11001000 00010111 00010
11001000 00010111 00011000
11001000 00010111 00011
otherwise
Link interface
0
1
2
3
11001000 00010111 00011000 10101010
examples:
which interface?
which interface?
********
***
********
***
********
11001000 00010111 00010110 10100001
match!
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
Longest Prefix Matching
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
Longest Prefix Match
Destination Address Range
11001000 00010111 00010
11001000 00010111 00011000
11001000 00010111 00011
otherwise
Link interface
0
1
2
3
11001000 00010111 00011000 10101010
examples:
which interface?
which interface?
********
***
********
***
********
11001000 00010111 00010110 10100001
match!
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
Longest Prefix Matching
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
Longest Prefix Match
Destination Address Range
11001000 00010111 00010
11001000 00010111 00011000
11001000 00010111 00011
otherwise
Link interface
0
1
2
3
11001000 00010111 00011000 10101010
examples:
which interface?
which interface?
********
***
********
***
********
11001000 00010111 00010110 10100001
match!
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
CIDR – Longest Prefix Match
0
1
00
10
11
100
101
00*
0*
11*
Indian Institute of Technology Kharagpur
IP Addresses: How to Get One?
There are two questions:
How does host get IP address?
Indian Institute of Technology Kharagpur
DHCP: Dynamic Host Configuration Protocol
Goal: host dynamically obtains IP address from network server when it “joins” network
DHCP overview:
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
DHCP Client-server Scenario
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4
223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2
223.1.3.1
223.1.3.27
DHCP server
223.1.2.5
arriving DHCP client needs
address in this network
Typically, DHCP server will be co-located in router, serving all subnets to which router is attached
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
DHCP Client-server Scenario
DHCP server: 223.1.2.5
Arriving client
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
Broadcast: is there a DHCP server out there?
Broadcast: I’m a DHCP server! Here’s an IP address you can use
Broadcast: OK. I would like to use this IP address!
Broadcast: OK. You’ve got that IP address!
The two steps above can be skipped “if a client remembers and wishes to reuse a previously allocated network address” [RFC 2131]
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
DHCP: More than IP Addresses
DHCP can return more than just allocated IP address on subnet:
Indian Institute of Technology Kharagpur
DHCP: Example
router with DHCP
server built into
router
168.1.1.1
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
DHCP: Example
router with DHCP
server built into
router
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
IP Addressing: Last Words ...
Q: how does an ISP get block of addresses?
A: ICANN: Internet Corporation for Assigned Names and Numbers http://www.icann.org/
Q: are there enough 32-bit IP addresses?
"Who the hell knew how much address space we needed?" Vint Cerf (reflecting on decision to make IPv4 address 32 bits long)
Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross
Indian Institute of Technology Kharagpur
A Practice Problem
IP | Netmask | Next hop |
128.96.170.0 | 255.255.254.0 | Eth0 |
128.96.168.0 | 255.255.254.0 | Eth1 |
128.96.166.0 | 255.255.254.0 | R2 |
128.96.164.0 | 255.255.252.0 | R3 |
0.0.0.0 | 0.0.0.0 | R4 |
Problem courtesy: Computer Networks, Larry L Peterson and Bruce S Davie
Indian Institute of Technology Kharagpur
A Practice Problem
171 -- 10101011
254 -- 11111110
Logical AND -- 10101010 -- 170
Destination is Eth0
IP | Netmask | Next hop |
128.96.170.0 | 255.255.254.0 | Eth0 |
128.96.168.0 | 255.255.254.0 | Eth1 |
128.96.166.0 | 255.255.254.0 | R2 |
128.96.164.0 | 255.255.252.0 | R3 |
0.0.0.0 | 0.0.0.0 | R4 |
Problem courtesy: Computer Networks, Larry L Peterson and Bruce S Davie
Indian Institute of Technology Kharagpur
A Practice Problem
167 -- 10100111
254 -- 11111110
Logical AND -- 10100110 -- 166
IP | Netmask | Next hop |
128.96.170.0 | 255.255.254.0 | Eth0 |
128.96.168.0 | 255.255.254.0 | Eth1 |
128.96.166.0 | 255.255.254.0 | R2 |
128.96.164.0 | 255.255.252.0 | R3 |
0.0.0.0 | 0.0.0.0 | R4 |
Problem courtesy: Computer Networks, Larry L Peterson and Bruce S Davie
Indian Institute of Technology Kharagpur
A Practice Problem
167 -- 10100111
252 -- 11111100
Logical AND -- 10100100 -- 164
Longest Match is 254. Next hop Eth1
IP | Netmask | Next hop |
128.96.170.0 | 255.255.254.0 | Eth0 |
128.96.168.0 | 255.255.254.0 | Eth1 |
128.96.166.0 | 255.255.254.0 | R2 |
128.96.164.0 | 255.255.252.0 | R3 |
0.0.0.0 | 0.0.0.0 | R4 |
Problem courtesy: Computer Networks, Larry L Peterson and Bruce S Davie
Indian Institute of Technology Kharagpur
Next, we’ll look some IP layer services for the management of Internetwork ...
Indian Institute of Technology Kharagpur