Communication Networks
Communication Networks
Communication Networks
EE534
Sonali Chouhan
Dept of EEE
IITG
Why Internetworking?
To build a “network of networks” or internet
operating over multiple, coexisting, different network
technologies
providing ubiquitous connectivity through IP packet transfer
Net51 G Net53
Net
Net
G
G
G
Net55
Net
H G G
Net52
Net Net54
Net
H
Why Internetworking?
To provide universal communication services
independent of underlying network technologies
providing common interface to user applications
Best-effort
IP (ICMP, ARP)
connectionless
packet transfer
int1.int2.int3.int4
leongarcia@comm.utoronto.ca (intj = jth octet)
128.100.10.13
Intel
Encapsulation
TCP Header contains
source & destination HTTP Request
port numbers
IP Header contains
source and destination TCP
header HTTP Request
IP addresses;
transport protocol type
Source IP Address
Destination IP Address
Options Padding
Minimum 20 bytes
Up to 40 bytes in options fields
IP Packet Header
0 4 8 16 19 24 31
Source IP Address
Destination IP Address
Options Padding
Source IP Address
Destination IP Address
Options Padding
Total length: number of bytes of the IP packet including header and data,
maximum length is 65535 bytes.
Identification, Flags, and Fragment Offset: used for fragmentation and
reassembly (More on this shortly).
0 4
IP Packet Header
8 16 19 24 31
Source IP Address
Destination IP Address
Options Padding
Source IP Address
Destination IP Address
Options Padding
Source IP Address
Destination IP Address
Options Padding
Class B
14 bits 16 bits
1 0 netid hostid
a host
0 0 0 host in this
network
broadcast on
netid 1 1 1 1 1 1 1 distant
network
Private IP Addresses
Specific ranges of IP addresses set aside for
use in private networks (RFC 1918)
Use restricted to private internets; routers in
public Internet discard packets with these
addresses
Range 1: 10.0.0.0 to 10.255.255.255
Range 2: 172.16.0.0 to 172.31.255.255
Range 3: 192.168.0.0 to 192.168.255.255
Network Address Translation (NAT) used to
convert between private & global IP addresses
Example of IP Addressing
128.135.40.1 128.140.5.40
H Interface Interface H
Address is Address is
128.135.10.2 128.140.5.35
Network Network
R
128.135.0.0 128.140.0.0
H H
H
128.135.10.20 128.135.10.21
128.140.5.36
Original
1 0 Net ID Host ID
address
Subnetted
address 1 0 Net ID Subnet ID Host ID
Subnetting Example
Organization has Class B address (16 host ID bits) with
network ID: 150.100.0.0
Create subnets with up to 100 hosts each
7 bits sufficient for each subnet
16-7=9 bits for subnet ID
Apply subnet mask to IP addresses to find corresponding
subnet
Example: Find subnet for 150.100.12.176
IP add = 10010110 01100100 00001100 10110000
Mask = 11111111 11111111 11111111 10000000
AND = 10010110 01100100 00001100 10000000
Subnet = 150.100.12.128
Subnet address used by routers within organization
Subnet Example
H1 H2
150.100.12.154 150.100.12.176
150.100.12.128
150.100.12.129
150.100.0.1
R1
To the rest of H3 H4
the Internet 150.100.12.4
150.100.12.24 150.100.12.55
150.100.12.0
150.100.12.1
R2 H5
150.100.15.54 150.100.15.11
150.100.15.0
Routing with Subnetworks
IP layer in hosts and routers maintain a routing table
Originating host: To send an IP packet, consult
routing table
If destination host is in same network, send packet directly
using appropriate network interface
Otherwise, send packet indirectly; typically, routing table
indicates a default router
Router: Examine IP destination address in arriving
packet
If dest IP address not own, router consults routing table to
determine next-hop and associated network interface &
forwards packet
Routing Table
150.100.12.0
150.100.12.1
R2 H5
150.100.15.54 150.100.15.11
Routing Table at H5
150.100.15.0
Destination Next-Hop Flags Net I/F
127.0.0.1 127.0.0.1 H lo0 150.100.12.176
150.100.12.0
150.100.12.1
150.100.12.176
R2 H5
Routing Table at R2
150.100.15.54 150.100.15.11
Destination Next-Hop Flags Net I/F
150.100.15.0
127.0.0.1 127.0.0.1 H lo0
default 150.100.12.4 G emd0
150.100.15.0 150.100.15.54 emd1
150.100.12.0 150.100.12.1 emd0
Example: Host H5 sends packet to host H2
H1 H2
150.100.12.154 150.100.12.176
150.100.12.128
150.100.12.129 150.100.12.176
150.100.0.1
R1
To the rest of H3 H4
the Internet 150.100.12.4
150.100.12.24 150.100.12.55
150.100.12.0
150.100.12.1
R2 H5
Routing Table at R1
150.100.15.54 150.100.15.11
Destination Next-Hop Flags Net I/F
150.100.15.0
127.0.0.1 127.0.0.1 H lo0
150.100.12.176 150.100.12.176 emd0
150.100.12.0 150.100.12.4 emd1
150.100.15.0 150.100.12.1 G emd1
IP Address Problems
In the 1990, two problems became apparent
IP addresses were being exhausted
IP routing tables were growing very large
IP Address Exhaustion
Class A, B, and C address structure inefficient
Class B too large for most organizations, but future proof
Class C too small
Rate of class B allocation implied exhaustion by 1994
IP routing table size
Growth in number of networks in Internet reflected in # of table entries
From 1991 to 1995, routing tables doubled in size every 10 months
Stress on router processing power and memory allocation
Short-term solution:
Classless Interdomain Routing (CIDR), RFC 1518
New allocation policy (RFC 2050)
Private IP Addresses set aside for intranets
Long-term solution: IPv6 with much bigger address space
Supernetting
Classes A and B are almost depleted.
Class C addresses are still available.
What if a company needs a network larger than
254 hosts?
Give the company several consecutive blocks of
C addresses and treat these as a single
supernetwork
(Supernetting applies only to the class C
addresses)
Supernetting
• Assign an organization a block of plentiful
addresses (class C) rather than a single scarce
(class B) address
• Example:
• An organization wants to connect to the Internet
• The organization would prefer a class B address
• Plans to subnet its various physical networks using the
third octet of the IP address to represent the subnet
• This would allow the organization to have 254 physical networks
with up to 254 hosts per network
Supernetting (cont)
• Example (cont):
• Instead of getting a class B address, the organization is
given 256 contiguous class C addresses
• E.g. 192.17.0.0 – 192.17.255.0
• Then:
• The organization can have up to 256 physical networks (each with
its own class C network address)
• Each physical network can have up to 254 hosts
• Result: a block of plentiful addresses (class C)
substituted for a single scarce (class B) address
New Address Allocation Policy
H1 H2 H3 H4
Reassemble
at destination
Source Router Destination
Fragment
at source Fragment
IP IP
at router
Network Network
Internet Control Message Protocol (ICMP)
Encapsulated in IP packet (protocl type = 1)
Handles error and control messages
If router cannot deliver or forward a packet, it sends an
ICMP “host unreachable” message to the source
If router receives packet that should have been sent to
another router, it sends an ICMP “redirect” message to
the sender; Sender modifies its routing table
ICMP “router discovery” messages allow host to learn
about routers in its network and to initialize and update
its routing tables
ICMP echo request and reply facilitate diagnostic and
used in “ping”
ICMP Basic Error Message Format
0 8 16 31
Unused
Data
Source Address
Destination Address
Source Address
Destination Address
Basic header
Next header = TCP segment
TCP
Extension
headers processed in order of
appearance