0% found this document useful (0 votes)
60 views35 pages

Internet Protocol (IP) : by Behzad Akbari

The document discusses the Internet Protocol (IP) network layer. It describes how IP encapsulates data segments from the transport layer into datagrams and delivers them across networks. The key aspects covered include IP datagram format, fragmentation and reassembly, IP addressing including classes and CIDR notation, private addresses, and how networks obtain address space from ISPs in a hierarchical manner.

Uploaded by

spikedudley
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views35 pages

Internet Protocol (IP) : by Behzad Akbari

The document discusses the Internet Protocol (IP) network layer. It describes how IP encapsulates data segments from the transport layer into datagrams and delivers them across networks. The key aspects covered include IP datagram format, fragmentation and reassembly, IP addressing including classes and CIDR notation, private addresses, and how networks obtain address space from ISPs in a hierarchical manner.

Uploaded by

spikedudley
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 35

Internet Protocol (IP)

by
Behzad Akbari
Internet Network layer
 transport segment from
sending to receiving host application
transport
 on sending side network
data link network
encapsulates segments into physical
network
data link
data link
physical
network
data link
datagrams physical physical
network
 on rcving side, delivers data link
physical network
segments to transport layer data link
physical

 network layer protocols in network


network
data link
every host, router data link
physical
physical

 Router examines header network


data link application
physical transport
fields in all IP datagrams network
data link
passing through it physical
IP datagram format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper Internet
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead data taken, specify
with TCP? (variable length, list of routers
 20 bytes of TCP typically a TCP to visit.
 20 bytes of IP or UDP segment)
 = 40 bytes + app
layer overhead
IP Fragmentation & Reassembly
 network links have MTU
(max.transfer size) - largest
possible link-level frame.
 different link types, different
fragmentation:
MTUs in: one large datagram
 large IP datagram divided out: 3 smaller datagrams
(“fragmented”) within net
 one datagram becomes

several datagrams
reassembly
 “reassembled” only at final

destination
 IP header bits used to

identify, order related


fragments
IP Fragmentation and Reassembly

length ID fragflag offset


Example =4000 =x =0 =0
 4000 byte datagram
One large datagram becomes
 MTU = 1500 bytes
several smaller datagrams

length ID fragflag offset


=1500 =x =1 =0
1480 bytes in
data field length ID fragflag offset
=1500 =x =1 =185
offset =
1480/8 length ID fragflag offset
=1040 =x =0 =370
IP Addressing: introduction
 IP address: 32-bit 223.1.1.1
identifier for host, router 223.1.2.1
interface 223.1.1.2
223.1.1.4 223.1.2.9
 interface: connection
between host/router and 223.1.2.2
physical link 223.1.1.3 223.1.3.27
 router’s typically have
multiple interfaces
 host may have multiple 223.1.3.1 223.1.3.2
interfaces
 IP addresses associated
with each interface

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1
IP Address as a
32-Bit Binary Number
Class Full IP Addressing : IP Address
Classes
IP Address Classes
IP Addresses as Decimal Numbers
Hosts for Classes of
IP Addresses

Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts


Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts
Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts
*
Subtracting the network and broadcast reserved address
IP Addresses as Decimal Numbers
Network IDs and Broadcast
Addresses
An IP address such as 176.10.0.0 that has all binary 0s in
the host bit positions is reserved for the network address.

An IP address such as 176.10.255.255 that has all binary 1s


in the host bit positions is reserved for the broadcast
address.
Private Addresses
Reserved Address Space
 Network ID
 Broadcast address
 Hosts for classes of IP addresses
Subnets
 IP address: 223.1.1.1

 subnet part (high order 223.1.2.1


223.1.1.2
bits) 223.1.2.9
223.1.1.4
 host part (low order bits)
 What’s a subnet ? 223.1.2.2
223.1.1.3 223.1.3.27
 device interfaces with
same subnet part of IP LAN
address 223.1.3.2
223.1.3.1
 can physically reach
each other without
intervening router
network consisting of 3 subnets
Subnets 223.1.1.2

How many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2


IP addressing: CIDR
CIDR: Classless InterDomain Routing
 subnet portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in subnet
portion of address

subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
IP addresses: how to get one?

Q: How does host get IP address?

 hard-coded by system admin in a file


 Wintel: control-panel->network->configuration->tcp/ip->properties
 UNIX: /etc/rc.config
 DHCP: Dynamic Host Configuration Protocol: dynamically get address from as
server
 “plug-and-play”
(more in next chapter)
IP addresses: how to get one?
Q: How does network get subnet part of IP addr?
A: gets allocated portion of its provider ISP’s address
space

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23


Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23
Hierarchical addressing: route aggregation

Hierarchical addressing allows efficient advertisement of routing


information:

Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
Hierarchical addressing: more specific routes

ISPs-R-Us has a more specific route to Organization 1


Organization 0
200.23.16.0/23

“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
IP addressing: the last word...

Q: How does an ISP get block of addresses?


A: ICANN: Internet Corporation for Assigned
Names and Numbers
 allocates addresses

 manages DNS

 assigns domain names, resolves disputes


NAT: Network Address Translation

rest of local network


Internet (e.g., home network)
10.0.0/24 10.0.0.1

10.0.0.4
10.0.0.2
138.76.29.7

10.0.0.3

All datagrams leaving local Datagrams with source or


network have same single source destination in this network
NAT IP address: 138.76.29.7, have 10.0.0/24 address for
different source port numbers source, destination (as usual)
NAT: Network Address Translation

 Motivation: local network uses just one IP address as far as


outside word 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).


NAT: Network Address Translation
Implementation: NAT router must:

 outgoing datagrams: replace (source IP address, port #) of every


outgoing datagram to (NAT IP address, new port #)
. . . remote clients/servers will respond using (NAT IP address,
new port #) as destination addr.

 remember (in NAT translation table) every (source IP address, port


#) to (NAT IP address, new port #) translation pair

 incoming datagrams: replace (NAT IP address, new port #) in dest


fields of every incoming datagram with corresponding (source IP
address, port #) stored in NAT table
NAT: Network Address Translation

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, 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
NAT: Network Address Translation

 16-bit port-number field:


 60,000 simultaneous connections with a single LAN-side
address!
 NAT is controversial:
 routers should only process up to layer 3
 violates end-to-end argument
 NAT possibility must be taken into account by app designers,
eg, P2P applications
 address shortage should instead be solved by IPv6
ICMP: Internet Control Message Protocol

 used by hosts & routers to


Type Code description
communicate network-level
0 0 echo reply (ping)
information
3 0 dest. network unreachable
 error reporting: unreachable
3 1 dest host unreachable
host, network, port, protocol 3 2 dest protocol unreachable
 echo request/reply (used by
3 3 dest port unreachable
ping) 3 6 dest network unknown
 network-layer “above” IP: 3 7 dest host unknown
 ICMP msgs carried in IP 4 0 source quench (congestion
datagrams control - not used)
8 0 echo request (ping)
 ICMP message: type, code plus
9 0 route advertisement
first 8 bytes of IP datagram
10 0 router discovery
causing error
11 0 TTL expired
12 0 bad IP header
Traceroute and ICMP
 Source sends series of UDP  When ICMP message arrives,
segments to dest source calculates RTT
 First has TTL =1
 Traceroute does this 3 times
 Second has TTL=2, etc.
Stopping criterion
 Unlikely port number
 UDP segment eventually
 When nth datagram arrives to arrives at destination host
nth router:
 Destination returns ICMP “host
 Router discards datagram

 And sends to source an


unreachable” packet (type 3,
ICMP message (type 11, code 3)
code 0)  When source gets this ICMP,
 Message includes name of stops.
router& IP address
IPv6
 Initial motivation: 32-bit address space soon to be
completely allocated.
 Additional motivation:
 header format helps speed processing/forwarding
 header changes to facilitate QoS

IPv6 datagram format:


 fixed-length 40 byte header

 no fragmentation allowed
IPv6 Header (Cont)
Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same “flow.”
(concept of“flow” not well defined).
Next header: identify upper layer protocol for data
Other Changes from IPv4
 Checksum: removed entirely to reduce processing
time at each hop
 Options: allowed, but outside of header, indicated by
“Next Header” field
 ICMPv6: new version of ICMP
 additional message types, e.g. “Packet Too Big”
 multicast group management functions
Transition From IPv4 To IPv6
 Not all routers can be upgraded simultaneous
 no “flag days”
 How will the network operate with mixed IPv4 and IPv6
routers?
 Tunneling: IPv6 carried as payload in IPv4 datagram
among IPv4 routers
Tunneling
A B E F
Logical view: tunnel

IPv6 IPv6 IPv6 IPv6

A B C D E F
Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6

Flow: X Src:B Src:B Flow: X


Src: A Dest: E Dest: E Src: A
Dest: F Dest: F
Flow: X Flow: X
Src: A Src: A
data Dest: F Dest: F data

data data

A-to-B: E-to-F:
B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside
IPv4 IPv4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy