0% found this document useful (0 votes)
10 views75 pages

Week 6

The document provides an overview of computer networks and internet protocols, focusing on the network layer and IPv4 addressing. It discusses the hierarchical organization of the internet, autonomous systems, and the principles of IP addressing, including classful addressing and CIDR. Additionally, it covers Network Address Translation (NAT) and its role in managing IP addresses and facilitating communication between private networks and the internet.

Uploaded by

sahilsahu1799
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views75 pages

Week 6

The document provides an overview of computer networks and internet protocols, focusing on the network layer and IPv4 addressing. It discusses the hierarchical organization of the internet, autonomous systems, and the principles of IP addressing, including classful addressing and CIDR. Additionally, it covers Network Address Translation (NAT) and its role in managing IP addresses and facilitating communication between private networks and the internet.

Uploaded by

sahilsahu1799
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

COMPUTER NETWORKS AND

INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR

1
Network Layer I - Introduction
Application Application
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Network (Internet) Layer Services

Flow and
End to end Connection Reliable Data Ordered Packet
Congestion
packet delivery Establishment Delivery Delivery
Control
UDP TCP
Transport

Addressing Datagram delivery (unreliable) Routing


Network

Data Link
Internet Architecture – Basic Principles
• Internet is organized in a hierarchical fashion.

Router
SW Lab 1 SW Lab 2
CSE Network
Internet Architecture – Basic Principles
• Internet is organized in a hierarchical fashion.

SW Lab
1 EE Lab
1
SW
EE Lab
CSE Network Lab 2
EEE Network 2

IITKGP Network
Internet Architecture – Basic Principles
• Internet is organized in a hierarchical fashion.

EEE
EEE

CSE
IITKGP IITBBS CSE
Network Network
ERNET Network
Internet Architecture – Basic Principles
• Internet is organized in a hierarchical fashion.

IITKGP BSNL
Public
BSNL
IITBBS
ERNET BSNL Corporat
Network e
Network
Bharti Airtel Network
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
Autonomous System Graph for India

Source: https://labs.apnic.net/vizas/#IN
Internet Architecture

Internet Service Providers


(ISP) – An AS provides
Internet connectivity to
another group of ASes or
end users
Peering between ISPs
Communication between Two Nodes over ISPs
IP Addressing – Basic Principles
• We need to forward data packets from one network to another
network via different intermediate networks.
Host 2
AS 11

AS 10 AS 12
Host 1
AS 13
IP Addressing – Basic Principles
• The address should identify a network as well as a host inside a
network
Host 2
AS 11

AS 10 AS 12
Host 1
AS 13
15
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR

1
Network Layer II - IPv4 Addressing (Classful Addresses)
Application Application
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
IP Addressing – Basic Principles
• The address should identify a network as well as a host inside a
network
Host 2
AS 11

AS 10 AS 12
Host 1
AS 13
IP Addressing

Network address Host address

• Divide the address space (32 bit in IPv4) among network address and
host address

• The old age – Classful addressing: Fixed number of bits for network
address and host address
Classful Addressing

• How to identify a class – use the first few bits


– 0 – Class A, 10 – Class B, 110 – Class C, 1110 – Class D, 1111 – Class E
Network Address and Broadcast Address
• Network address – identify a network
– All 0’s in the host address part
– Ex-1 (Class A): 01111110.00000000.00000000.00000000 (126.0.0.0)
– Ex-2 (Class B): 10111101.11101001.00000000.00000000 (189.233.0.0)

• Broadcast address – send the data to all the hosts of a network


– All 1’s in the host address part
– Ex-1 (Class A): 01111110.11111111.11111111.11111111 (126.255.255.255)
– Ex-2 (Class B): 10111101.11101001.11111111.11111111 (189.233.255.255)

• How many valid hosts can be there in a Class A, in a Class B and in a Class C IP
address?
Subnetting and Supernetting – Classless Inter-domain Routing (CIDR)

• You have 255 hosts in a network. Which IPv4 address class will you
use – Class C or Class B ?
– Class C – not possible
– Class B – huge address space is lost (using only 255 addresses out of
possible 216-2 addresses)
Subnetting and Supernetting – Classless Inter-domain Routing (CIDR)

• Split a large network or combine multiple small networks for efficient use of
address space
– Subnetting – divide a large network into multiple small networks
– Supernetting – combine multiple small networks into a single large
network

• Subnet mask – denote the number of bits in the network address field
Divide a Network into Subnets
CIDR – Addressing Format

IP Address 10111111 10110100 01010011 11101011

Netmask 11111111 11110000 00000000 00000000


Subnet Address Host Address
CIDR – Addressing Format

• We write the IP address as 191.180.83.235/12 in CIDR notation


– The first 12 bits are the network address and rest (32-12)=20 bits are
for host address

• The subnet mask is 255.240.0.0


CIDR - Manual IP Setting in the OS
13
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR

1
Network Layer III - IPv4 Addressing (CIDR)
Application Application
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
CIDR – Addressing Format

IP Address 10111111 10110100 01010011 11101011

Netmask 11111111 11110000 00000000 00000000


Subnet Address Host Address
Divide a Network into Subnets
• Let the IP address of a network is 203.110.0.0/16

• We want to divide this network into three subnets

• We need 3 bits for subnets – why not 2 bits?


– Subnet 1 – 100, Subnet 2– 101, Subnet 3 – 110

• Rest 13 bits are used for addressing the hosts of those subnets.

• The subnets are – 203.110.128.0/19, 203.110.160.0/19, 203.110.192.0/19


All Zero and All One Subnets
We normally avoid “all 192.168.0.0/16
zero” and “all one”
subnets.
192.168.128.0/17

192.168.0XXXXXXX.X 192.168.1XXXXXXX.X
192.168.0.0/17

Broadcast address for this subnet is


The network address for the
192.168.255.255, broadcast address for
subnet and the original network is
the original network is also
identical – Subnet Zero
192.168.255.255 – All-One Subnet
CIDR Example

CSE – 2000 Hosts VGSOM – 500 Hosts EE – 500 Hosts

203.110.0.0/19
CIDR Example

CSE – 2000 Hosts VGSOM – 500 Hosts EE – 500 Hosts


9 bit 9 bit
11 bit hosts hosts
hosts

203.110.0.0/19
CIDR Example
• Address space – 203.110.0.0/19
– 13 bits are available to serve all the hosts of IITKGP network
– We need to divide these address space among 3 subnets

• CSE – 11 bits, VGSOM – 9 bits, EE – 9 bits for host address

• We have 2 bits left for identifying three subnets – Is this possible?


– Avoid “all zero” and ”all one” subnets

• Let us apply CIDR – Combine VGSOM and EE Networks together


CIDR Example

CSE – 2000 Hosts


9 bit
VGSOM – 500 Hosts 9 bit EE – 500 Hosts
11 bit hosts hosts
hosts 10 bit
hosts

203.110.0.0/19
CIDR Example

CSE – 11 bits, VGSOM+EE – 10 bits

• Network address – 203.110.0.0/19, 203.110.000XXXXX.XXXXXXXX

• CSE network address 203.110.00010XXX.XXXXXXXX (203.110.16.0/21)

• VGSOM+EE network address 203.110.00001XXX.XXXXXXXX


(203.110.8.0/21)
CIDR Example

CSE – 2000 Hosts 9 bit VGSOM – 500 Hosts 9 bit EE – 500 Hosts
hosts hosts
11 bit
hosts 10 bit
hosts
203.110.16.0/21

203.110.8.0/21 203.110.0.0/19
CIDR Example

VGSOM – 9 bits, EE – 9 bits

• Network address – 203.110.8.0/21, 203.110.00001XXX.XXXXXXXX

• VGSOM network address 203.110.0000110X.XXXXXXXX


(203.110.12.0/23)

• EE network address 203.110.0000101X.XXXXXXXX (203.110.10.0/23)


CIDR Example

CSE – 2000 Hosts


9 bit
VGSOM – 500 Hosts 9 bit EE – 500 Hosts
11 bit hosts hosts
hosts 10 bit
hosts 203.110.12.0/23 203.110.10.0/23
203.110.16.0/21 203.110.8.0/21
203.110.0.0/19
14
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR

1
Network Address Translation (NAT)

Private Network 1 Private Network 2


Internet
Issues with IPv4 Addressing
• The address space is limited - number of devices (networking equipment)
are increasing exponentially.

• A large number of addresses are wasted or remain unutilized (Class D or


Class E).

• Solution: Make the address reusable, leveraging on the fact that not all
users or all devices will connect to the Internet at the same time.
Network Address Translation (NAT)
• Divide addresses into reusable (private) and non-reusable (public) blocks
• Translate internal (private) addresses to external (public) addresses
• Hide internal machines from external devices
• Allow Internet access to large number of users via few public addresses
– IPv4 private address
• 10.0.0.0-10.255.255.255
• 172.16.0.0-172.32.255.255
• 192.168.0.0-192.168.255.255
Basic Operation of NAT

Source : 128.143.71.21
Source : 10.0.1.2 Destination : 213.168.112.3
Destination : 213.168.112.3
NAT Device
Private address: 10.0.1.2
Public address: 128.143.71.21
Source : 213.168.112.3 Public address: 213.168.112.3
Destination : 10.0.1.2
Source : 213.168.112.3
Private address Public address Destination : 128.143.71.21
10.0.1.2 128.143.71.21
Working Principles of NAT
• Organizations manages internal private network
• NAT boxes manages a pool of public IP address
• For outgoing connections, NAT boxes selects one of the IP address from
its pool, and forward packet from that IP
Migration between ISPs
• An organization can connect to multiple ISPs for better reliability
• NAT allow easy interchange between ISPs by changing IP addresses in
NAT boxes
– Without NAT, every internal system address need to be changed to
reflect the network IP of the ISP
• NAT box can be configured to use alternative ISPs in case of a failure
Migration between Network Service Provider
Source : 128.143.71.21
Destination : 213.168.112.3

Source : 10.0.1.2 ISP 1


Destination : 213.168.112.3

Private address: 10.0.1.2


Public address: 128.143.71.21
NAT Device X
128.195.4.120
ISP 2
Source : 128.143.71.21
Destination : 128.195.4.120

Private address Public address


10.0.1.2 128.143.71.21
128.195.4.120
IP Masquerading
• Single public IP address is mapped to multiple hosts
• NAT box modify port address and replace private IP address to public IP
address
– Keep mapping in a table to forward incoming packet to proper internal
host
IP Masquerading

Source : 10.0.1.2
port : 2001 Source : 128.143.71.21
port : 2100
Private address: 10.0.1.2 NAT Device

Private address: 10.0.1.3 Public address: 213.168.112.3


Source : 128.143.71.21
Source : 10.0.1.3
port : 4444
port. : 3020

Private address Public address


10.0.1.2/2001 128.143.71.21/2100
10.0.1.3/3020 128.143.71.21/4444
Load Balancing of Servers
• Balance the load of multiple identical server accessible from a single IP
address
• NAT box translate different incoming connection to different internal IP
address to balance load between server
• Internal systems are configured with private addresses
Load Balancing of Servers
Source : 128.195.4.120
Destination : 128.143.71.21
Source : 128.195.4.120 Source : 213.168.12.3
Destination : 10.0.1.2 Destination : 128.143.71.21
Private address: 10.0.1.2
NAT Device

Private address: 10.0.1.3

Source : 128.195.4.120
Destination : 10.0.1.3
INSIDE NETWORK OUTSIDE NETWORK
Private address Public address Public address
10.0.1.2 128.143.71.21 128.195.4.120
10.0.1.3 128.143.71.21 213.168.12.3
13
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR

1
Internet Protocol Version 6 (IPv6)

Indian Institute of Technology Kharagpur


Why do We Need a New IP Structure?

● Address space is not sufficient even with CIDR.

● QoS is vaguely defined - need real time service support for modern-
day applications

● Mobile applications are unmanageable

● There is no direct security support in IPv4

Indian Institute of Technology Kharagpur


IPv6 Features
• Larger address space
• Globally unique and hierarchical addressing
• Optimized routing table using prefixes rather than address classes
• Auto-configuration of network interfaces
• Support for encapsulation
• Service class support to manage QoS classes
• Built-in authentication and encryption
• Compatibility with IPv4
IPv6 Header Format

• 128 bit source address and


destination address

Image Source: IBM Redbook, TCP/IP


Protocols and Technical Overview
Extension Headers

• Additional information are transmitted


through the extension headers.

• The base header points to the extension


headers

Image Source: IBM Redbook, TCP/IP


Protocols and Technical Overview
IPv6 Addressing
• 128 bit addresses - represented in 8 hexadecimal numbers
FE80:0000:0000:0000:0001:0800:23E:F5DB

• Leading zeros can be omitted - FE80:0:0:0:1:800:23E7:F5DB

• A group of zeros can be replaced by a double colon -


FE80::1:800:23E7:F5DB (Can be used only once)
Address Space Allocation based on Prefix

Image Source: IBM Redbook, TCP/IP Protocols and Technical Overview


Address Space Allocation based on Prefix

Image Source: IBM Redbook, TCP/IP Protocols and Technical Overview


Global Unicast Address Format
• Global routing prefix: A value assigned to a site for a cluster of
subnets/links. The global routing prefix is designed to be structured
hierarchically

Image Source: IBM Redbook, TCP/IP Protocols and Technical Overview


ICMPv6 - Neighbor Discovery
• Enables a node to identify other hosts and routers on its links

• The node needs to know of at least one router so that it knows where to
forward packets if a target node is not on its local link

• ARP request/response in IPv4


Neighbor Discovery Example

A wants to find out B

Image Source: IBM


Redbook, TCP/IP
Protocols and
Technical Overview
Neighbor Discovery - Neighbor Solicitation
• The destination address is the
address of the solicitated node
• An improvement over ARP
broadcast

Image Source: IBM Redbook, TCP/IP Protocols and


Technical Overview
Neighbor Discovery - Neighbor Advertisement
• Response of the neighbor
solicitation
• Three flags
– R: Sender of the advertisement is a
router
– S: Advertisement is a response to a
solicitation
– O: Override, must update a cached
information
Image Source: IBM Redbook, TCP/IP Protocols and Technical
Overview
IPv6 Mobility Support
• A mobile node uses a temporary address when it is away from the home
location
– Use IPv6 Destination Optional header to store its home address
• A mobile station can list the all routing header for the packets to follow a
particular path for establishing connection with a service provider network
• Packets sent to a mobile node can be tunneled by IPv6 routing headers
• Do not require foreign agents like IPv4 - neighbor discovery and address
autoconfiguration can be used to connect a node with any network
Migrating from IPv4 to IPv6
• Dual stack IP implementations

Image Source: IBM


Redbook, TCP/IP
Protocols and Technical
Overview
Migrating from IPv4 to IPv6
• Tunneling: Tunnel IPv4 headers through IPv6 headers and vice-versa

• Header Translation: Translate a IPv4 header to a IPv6 header and vice-


versa
– Address must be translated as well
– Take low order 32 bits for IPv6 to IPv4
– Append ::FFFF/96 prefix for IPv4 to IPv6
Address Translation
• IPv4 Address: 202.141.80.20
• IPv6 Address: CA8D:5014::FFFF

• IPv6 Address: FE80:2381:0000:0000:0001:0800:23E:F5DB


• IPv4 Address: 254.128.35.129
Interesting Reads
• RFC 2460 – Internet Protocol, Version 6 (IPv6) (December 1998)
• RFC 4291 – IP Version 6 Addressing Architecture (February 2006)
• RFC 3587 – IPv6 Global Unicast Address Format (August 2003)
• IANA Assignment Documentation: INTERNET PROTOCOL VERSION 6
MULTICAST ADDRESSES, June 2006
http://www.iana.org/assignments/ipv6-multicast-addresses
• 6NET http://www.6net.org
20

You might also like