You are on page 1of 20

Set 16: Internet Protocol

Dr. Anirudh Paranjothi


Oklahoma State University
CS 4283/5383

11/7/23 Computer Networks AP 16-1


Internet: A Collection of Subnetworks
• The Internet is an interconnected collection of many networks.
• The IP protocol glues all the different networks together.

11/7/23 Computer Networks AP 16-4


IPv4 header showing field lengths

Some of the
options

11/7/23 Computer Networks AP 16-8


IP Address Format

11/7/23 Computer Networks AP 16-9


Special IP Addresses

11/7/23 Computer Networks AP 16-10


Dotted decimal notation

• Dotted decimal notation is a convention for representing 32-bit


internet addresses in decimal
• Convert each byte of address into decimal; display separated by
periods (“dots”)

• Computer Science: 129.15.78.xxx


1000001.00001111.01001110.xxxxxxxx
Class B
address

11/7/23 Computer Networks AP 16-11


•IP addressing
• IP datagram format
Subnets • IP subnets
• Classless Interdomain routing (CIDR)
• NAT

A campus network consisting of LANs for various departments.

11/7/23 Computer Networks AP 16-12


Subnets: Example

A class B network subnetted into 64 subnets.

11/7/23 Computer Networks AP 16-13


•IP addressing
• IP datagram format
CIDR – Classless InterDomain Routing • IP subnets
• Classless Interdomain routing (CIDR)
• NAT

• Classful addressing:
– inefficient use of address space, address space exhaustion
– e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that
network
• CIDR solves the problem of IP address shortage
– Allocate remaining IP addresses in variable-sized blocks, without regards to classes.

network host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
11/7/23 Computer Networks AP 16-14
Longest Prefix Match
Destination Address 128.143.71.21
• Longest Prefix Match: Search for the
routing table entry that has the longest
match with the prefix of the destination IP Destination address Next hop
address
1. Search for a match on all 32 bits 10.0.0.0/8 R1
2. Search for a match for 31 bits 128.143.0.0/16 R2
3. ……….. 128.143.64.0/20 R3
4. Search for a match on 0 bits 128.143.192.0/20 R3
128.143.71.0/24 R4
Example: Packet will 128.143.71.55/32 R3
be routed to Router 3 default R5

The longest prefix match for


128.143.71.21 is for 24 bits with
entry 128.143.71.0/24
Datagram will be sent to R4

128.143.71.21 .71.0001 0101

128.143.71.0/24 .71.xxxx xxxx


128.143.71.55/32 .71.0011 0111

15
11/7/23 Computer Networks
Getting a datagram from source to dest.

forwarding table in router


misc Dest. Net router Nhops interface
223.1.1.1 223.1.2.2 data
fields
223.1.1 - 1 223.1.1.4
Arriving at 223.1.4, destined for 223.1.2.2 223.1.2 - 1 223.1.2.9
• look up network address of E in router’s 223.1.3 - 1 223.1.3.27
forwarding table
• E on same network as router’s interface
223.1.2.9 A 223.1.1.1
– router, E directly attached
• link layer sends datagram to 223.1.2.2 inside 223.1.2.1
link-layer frame via interface 223.1.2.9 223.1.1.2
• datagram arrives at 223.1.2.2!!! (hooray!) 223.1.1.4 223.1.2.9
B
223.1.2.2
223.1.1.3 223.1.3.27 E

223.1.3.1 223.1.3.2

11/7/23 Computer Networks AP 16-19


•IP addressing
• IP datagram format
• IP subnets
Network Address Translation (NAT) • Classless Interdomain routing (CIDR)
• NAT

• Motivation: local network can use just one IP address as far as outside
world is concerned:
– no need to be allocated range of addresses from ISP - just one IP
address is used for all devices
– can change addresses of devices in local network without notifying
outside world
– can change ISP without changing addresses of devices in local
network
– devices inside local net not explicitly addressable, visible by outside
world (a security plus).

11/7/23 Computer Networks AP 16-20


NAT: (Detailed) Example 3

NAT translation table


2: NAT router 1: host 10.0.0.1
WAN side addr LAN side addr
changes datagram sends datagram to
138.76.29.7, 5001 10.0.0.1, 3345 128.119.40.186, 80
source addr from
…… ……
10.0.0.1, 3345 to
138.76.29.7, 5001, S: 10.0.0.1, 3345
updates table D: 128.119.40.186, 80
10.0.0.1
1
S: 138.76.29.7, 5001
2 D: 128.119.40.186, 80 10.0.0.4
10.0.0.2
138.76.29.7 S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4
S: 128.119.40.186, 80
D: 138.76.29.7, 5001 3 10.0.0.3
4: NAT router
3: Reply arrives changes datagram
dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345

11/7/23 Computer Networks AP 16-23


ARP– The Address Resolution Protocol
• Internet Control Protocols
• ICMP
• Broadcast: Who owns IP address
• ARP
w.x.y.z? • DHCP
• The machine owning w.x.y.z
responds with its MAC address.

Three interconnected /24 networks: two Ethernets and an FDDI ring.

11/7/23 Computer Networks AP 16-27


Dynamic Host Configuration Protocol
• Internet Control Protocols
Operation of DHCP • ICMP
• ARP
• DHCP

11/7/23 Computer Networks AP 16-28


OSPF (Open Shortest Path First)
• Internet Routing Protocols
• “Open”: publicly available • OSPF
• Uses Link State algorithm • BGP
– LS packet dissemination
– Topology map at each node
– Route computation using Dijkstra’s algorithm
• OSPF advertisement carries one entry per neighbor router
• Advertisements disseminated to entire AS (via flooding)
– Carried in OSPF messages directly over IP
• OSPF is an Interior Gateway Routing Protocol which knows how to route within an
AS.
• Other IGRP protocols exist
– Example: Distance vector-based RIP protocol.

R4
R5 BGP
R3 AS3
(OSPF intra-AS
AS1 AS2 routing)
(RIP intra-AS (OSPF
routing) BGP intra-AS
routing)
R1 R2

Figure 4.5.2-new2: BGP use for inter-domain routing

11/7/23 Computer Networks AP 16-29


BGP – The Exterior Gateway Routing Protocol
• Inter-AS/Exterior gateway protocols have to worry about policies
– Whose packet to route as a transit AS
– Which AS/country should be avoided?
• Border Gateway Protocol (BGP) is the de-facto EGRP in the Internet
• BGP (RFC 1771) is based on distance vector protocol, but has some
differences:
– Each router keeps track of the path used. The path used may depend on policies
rather than just distance.
– Routers tell their neighbors the exact path it is using to reach a destination (this is
required to make policy decisions)
– BGP routes to networks (ASs), not individual hosts

• Internet Routing Protocols


• OSPF
• BGP

11/7/23 Computer Networks AP 16-33


BGP: Solving count to infinity problem

(a) A set of BGP routers. (b) Information


Destination sent to F.

Source

Routes from I and E are not considered in


routing packets from F to D. This is because I
and E use F to route to D à solves the “count
to infinity” problem!!!

11/7/23 Computer Networks MA 16-38


The Gang of Four

Link State Vectoring

OSPF
IGP RIP
IS-IS

EGP BGP

11/7/23 Computer Networks AP 16-39


Why different Intra- and Inter-AS routing ?

Policy:
• Inter-AS: admin wants control over how its traffic routed, who routes through its net.
• Intra-AS: single admin, so no policy decisions needed
Scale:
• hierarchical routing saves table size, reduced update traffic
Performance:
• Intra-AS: can focus on performance
• Inter-AS: policy may dominate over performance

11/7/23 Computer Networks AP 16-40

You might also like