0% found this document useful (0 votes)
68 views

IP Protocol xxOK

The document discusses the Internet Protocol (IP) which provides connectionless datagram service between end systems. IP packets can take different routes to their destination and delivery is not guaranteed. IP operates by attaching an IP header containing the destination address to data from higher layers, and encapsulating the packet with headers as it passes through networks on the way to the destination. Key issues addressed include routing, fragmentation and reassembly, and error control.

Uploaded by

Azeddien Sllame
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

IP Protocol xxOK

The document discusses the Internet Protocol (IP) which provides connectionless datagram service between end systems. IP packets can take different routes to their destination and delivery is not guaranteed. IP operates by attaching an IP header containing the destination address to data from higher layers, and encapsulating the packet with headers as it passes through networks on the way to the destination. Key issues addressed include routing, fragmentation and reassembly, and error control.

Uploaded by

Azeddien Sllame
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

2/14/2023

CS641
Computer Networking

Chapter C005: Internet Protocol


‫ بروتوكول األنترنت‬:‫الباب الخامس‬
‫د عزالدين محمد سويسي‬: ‫اعداد‬
[email protected]

OSI v TCP/IP
•Figure: illustrates the
layers of the TCP/IP
and OSI architectures,
showing roughly the
correspondence in
functionality between
them

2
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

1
2/14/2023

OSI Layers

3
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Internet Protocol (IP)


IP provides :-
• IP provides Connectionless or, datagram service
between end systems
• Advantages of such approach
1) Connectionless Internet is flexible
2) It can deal with variety of networks, (some networks may
be connectionless)… Essentially, IP requires very little
from the basic network
3) Connectionless Internet service can be highly robust
(same argument apply for datagram network service vs.
virtual circuit service)
4) Connectionless Internet service is best for connectionless
transport protocols (it does not impose unnecessary overhead)4
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

2
2/14/2023

Connectionless Internetworking
• Services offered by IP are unreliable
—Not guaranteed delivery
• Protocol will work with any combination of network types
—Not guaranteed order of delivery
• Packets can take different routes
—Reliability is responsibility of next upper layer (e.g.
TCP)
—This allows the protocol to react to both
congestion and failure in the Internet by
changing routes

5
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Figure :depicts typical example


using IP protocol
• Two LANs are interconnected by frame relay WAN
• Operation of IP for data exchange between host A
on LAN1 (network1) and host B on LAN2 (network2)
through the WAN
• Figure shows the protocol architecture and format of
the data unit at each stage
• End systems & routers must all share common IP protocol
• End systems must share the same protocols above IP
• Intermediate routers need only implement up through IP
• The IP at A receives data blocks be sent to B from
higher layers (software) of A
6
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

3
2/14/2023

Figure:
Internet Protocol Operation

7
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Figure :depicts typical example


using IP protocol
• IP attaches header (at time t1) that contains global Internet
address of B (logically two parts: network identifier + end
system identifier)
• The combination of IP header and upper-level data is called
(protocol data unit) PDU or datagram
• Datagram is then encapsulated with LAN protocol (LLC header
at t2; MAC header and trailer at t3) and sent to router which
strips off the LAN fields to read IP header at t6
• Router (X) encapsulates the datagram with frame relay protocol
fields at t8 and transmits it across WAN to another router (Y)
• This router (Y) strips off the frame relay fields and recovers
datagram, which it then warps in LAN fields appropriate to LAN
2 and sends it to B

8
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

4
2/14/2023

Figure :depicts typical example


using IP protocol
• Remember Encapsulation: (LAN 802.3 protocol)
—IP passes datagram down to next layer (LLC) with
instruction to send it to router X
—LLC passes this info down to MAC layer, which inserts MAC-
level address of router X into MAC header
—The block of data transmitted onto LAN1 includes data from
layers above TCP + TCP header + IP header + LLC header
+ MAC header and trailer (at time t3)
• LAN 1 then sends the packet to router X
• Router X removes MAC & LLC fields when receives the
packet from LAN 1. Then it must make routing decision
9
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Figure :depicts typical example


using IP protocol
• Router X decision may take following possibilities:
A. The destination station B is connected directly to one of the
networks to which the router is attached. If so, the router
sends the datagram directly to the destination
B. To reach the destination, one or more additional routers
must be traversed. If so, routing decision must be made: to
which router should the datagram be sent?
In both cases A&B, IP module in router sends the
datagram down to the next lower layer with destination
network address.
C. The router does not know the destination address. In this
case, router returns an error message to the source of the
datagram
10
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

5
2/14/2023

Figure :depicts typical example


using IP protocol
• Fragmentation:
—At each router, before data can be forwarded, the router
may need to fragment data unit to accommodate smaller
max packet size limitation on the outgoing network
—Data unit is split into two or more fragments, each of
which becomes an independent IP data unit
—Each new data unit is wrapped in lower-layer packet and
queued for transmission
—This process continues through as many routers till it data
unit reaches its destination
—Reassembly occur at destination end system buffers to get
original sent data
11
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Design Issues
1) Routing
2) Datagram lifetime
3) Fragmentation and re-assembly
4) Error control
5) Flow control

12
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

6
2/14/2023

Routing (1)
• End systems and routers maintain routing tables:-
a) Indicate next router to which datagram should be sent
b) Static routing tables
• May contain alternative routes if particular router is unavailable
c) Dynamic routing tables
• More flexible in responding to both congestion conditions and errors
• In Internet, e.g., when router goes off, all its neighbors will
send out status report to allow other routers and stations to
update their routing tables
• Congestion control is important because of mismatch in
capacity between LANs and WANs
• Routing tables can be used to support other internetworking
services (security, priority)
— Routing mechanism must assure that data of a given security
level are not allowed to pass through networks not cleared to
handle such data ‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬ 13

Routing (2)
• Source routing
—Source station specifies route as sequential list of routers,
in the datagram header, to be followed (useful for security
or priority requirements)
• Route recording service: to record a route, each
router appends its IP address to a list of addresses in
the datagram
• This feature is useful for testing and debugging purposes

14
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

7
2/14/2023

Datagram Lifetime
• Datagrams could loop indefinitely in internet
(if dynamic or alternate routing is used)
— (1) Consumes resources
— (2) Transport protocol may need upper bound on
datagram life time
• To overcome this??: Datagram marked with lifetime
—Time To Live field in IP
— Once lifetime expires, datagram discarded (not forwarded)
—How to implement lifetime??>>>>>
— (a) Hop count
• Decrement time to live on passing through each router
—(b) Time count (true time measure):
• The routers must know how long since datagram (or fragment) last
crossed a router (to know how much to decrement life )
15
• True time measure need global clocking mechanism
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Fragmentation and
Re-assembly
• Different networks may specify different max packet sizes
• Dictate uniform packet size across networks is inefficient
• Routers need to divide incoming datagrams into segments
(fragments) before transmitting on to next network
• When to re-assemble???
—(1) At destination (this is the easiest way)
• (disadv) Results in packets getting smaller as data
traverses internet (may make worse the efficiency of some
networks)
—(2) Intermediate re-assembly (routers)
• Need large buffers at routers (Buffers may fill with fragments)
• All fragments must go through same router (slow dynamic routing)
16
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

8
2/14/2023

IP Fragmentation (1)
• IP re-assembles at destination only
• Will use these fields in header
— Data Unit Identifier (ID)
• Uniquely identifies end system originated
datagram; in IP contains:
– Source and destination addresses
– Protocol layer generating data (e.g. TCP) (number)
– Identification supplied by that layer
—Data length
• Length of user data in octets
17
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

IP Fragmentation (2)
—Offset
• Means position of a fragment of user data in original
datagram data field
• In multiples of 64 bits (8 octets)
—More flag
• Indicates that this is not the last fragment

18
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

9
2/14/2023

Figure:
Fragmentation Example

19
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Dealing with Failure


• Re-assembly may fail if some fragments get lost
• IP service does not guarantee delivery
• Methods to detect failure:
• (1) Re-assembly time out
—Assigned to first fragment to arrive
—Real-time clock (local) assigned by reassembly function,
decremented when fragment is arrived
—If timeout expires before all fragments arrive, discard partial
data
• (2) Use datagram lifetime (time to live in IP)
—Part of each incoming fragment
— If time to live runs out, kill partial data (decrement process as no. 1) 20
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

10
2/14/2023

Error Control
• Internetworks does not guarantee datagram delivery
• Router should attempt to inform source if packet
discarded
— e.g. for time to live expiring
• Source may use this info to modify transmission strategy
• Source may inform high layer protocol
• Datagram identification needed to report which one
• Datagrams discarded because of:
1. lifetime expiration,
2. congestion,
3. Checksum error: notification is not possible the
address may damaged 21
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Flow Control
• Allows routers and/or stations to limit rate of
incoming data they receive
• Limited in connectionless systems
• The best approach is to send flow control packets to
other routers and source stations
—Requesting reduced data flow

22
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

11
2/14/2023

Addressing
• The concept of addressing in a communications
systems is complex and covers number of issues,
including:
—Addressing level
—Addressing scope
—Connection identifiers
—Addressing mode

23
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Figure:
TCP/IP Concepts

24
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

12
2/14/2023

Addressing Level
• Refers to level in comm.s architecture at which an entity is named
• Unique address for each end system (e.g., workstation or server)
• Unique address for each intermediate system (e.g., router)
• Network-level address ()
— TCP/IP model- IP address or internet address
— OSI model- network service access point (NSAP)
— Which used to route PDU through network or networks to system
indicated by IP address in PDU
• At destination data must routed to some process or
app. in system (system supports multiple apps, apps may support
multiple users)
— Each process assigned an identifier
— Referred to as port in TCP/IP
— Referred to as service access point (SAP) in OSI
25
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Addressing Scope
• Global address (internet address): key characteristics:
*1*Global nonambiguity
— global address identifies unique system
— Synonyms permitted
— System may have more than one global address
*2*Global applicability
— Possible at any global address to identify any other global address, in any
system, by means of global address of other system
— Global address is unique and globally applicable. It enables internet to route
data between any two systems in different networks
• Need unique address for each device interface on
network
— MAC address on IEEE 802 network and ATM host address
— Enables network to route data units through network and deliver
to intended system
— Network attachment point address 26
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

13
2/14/2023

Addressing mode
(see Table 8.1, page 281 William Stallings Book)
• Unicast
— Address refers to single system or port (individual)
• Broadcast
— Intended for all entities within a domain

• Multicast
— Intended for specific subset of entities

27
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Internet Protocol (IP) V4


• Part of TCP/IP and the most widely used
internetworking protocol>>>used by the Internet
• IP specified in two parts:
—interface with a higher layer (e.g., TCP), specifying services
that IP provides
—The actual protocol format and mechanisms
• RFC 791
—Get it and study it!
—www.rfc-editor.org
• Will (eventually) be replaced by IPv6 (see later)

28
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

14
2/14/2023

IP Services
• Primitives
—Specifies functions to be performed
—The actual form of primitive is implementation dependent
• e.g. subroutine call
—IP provides two service primitives at the interface to the
next higher layer
• Send : request transmission of data unit
• Deliver: used by IP to notify user of arrival of data unit
• Parameters
—Used to pass data and control info

29
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Figure: IPv4 Header

30
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

15
2/14/2023

Parameters (1)
• Source address: internetwork address of sending IP
entity
• Destination address: internetwork address of
destination IP entity
• Protocol: recipient protocol entity (IP user, such as TCP)
• Type of Service indicators:
— Specify treatment of data unit during transmission through networks
• Identification:
— used in combination with source & destination address & user protocol
— To uniquely identifies PDU
— Needed for re-assembly and error reporting
— Send only
31
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Parameters (2)
• Don’t fragment indicator
—Can IP fragment data
—If not, may not be possible to deliver
—Send only
• Time to live: measured in seconds
—Send only
• Data length: length of data being transmitted
• Option data: options requested by IP user; allows
for future extensibility
• Data: user data to be transmitted
32
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

16
2/14/2023

Options
• Security: allows security label to be attached to datagram
• Source routing: sequenced list of router addresses of
route to be followed.
—Strict routing: only identified routers may be visited
—Loose routing: other intermediate routers may be visited
• Route recording: to record sequence of visited routers by
datagram
• Stream identification: names reserved resources used
for stream service. This service provides special handling for
volatile periodic traffic (e.g. voice)
• Timestamping: source IP entity and some or all intermediate
routers add timestamp (precision to milliseconds) to data unit as it goes by
33
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Header Fields (1)


• Version (4 bits):
— Currently 4
— IP v6 - see later
• Internet Header Length (IHL) (4 bits):
— Length of header in 32 bit words (5 is min.)
— Including options
• DS/ECN (8bits):
— First 6 bits known as differentiated services (DS). Known as DS codepoint
gives 26 different classes of traffic. Designed to provide simple, easy-to-
implement, low-overhead tool to support range of network services that are
differentiated on basis of performance (QoS matter) (see section 9.4).
— Other 2 bits reserved for explicit congestion notification (ECN). To provide TCP
congestion control (routers in Internet alert end systems to growing congestion
within Internet, and end systems take steps to reduce the offered load to
Internet) (see section 7.3)
• Total length (16 bits):
— Total datagram length, in octets, including header+ data 34
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

17
2/14/2023

Header Fields (2)


• Identification (16 bits): sequence number
—Used with (source & destination) addresses and user
protocol to identify datagram uniquely
—Should be unique during datagram’s lifetime for source &
destination) addresses and user protocol
• Flags (3 bits): only two currently defined
—The more bit: used for fragmentation and reassembly
—The Don’t fragment bit: prohibits fragmentation when set.
Useful if known that destination does not have reassembly
capability. (datagram will be discarded if it exceeds
max size of en route network)
• Fragmentation offset (13 bits): indicates position of
fragment in original datagram. Measured in 64-bit units
35
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Header Fields (3)


• Time to live (TTL) (8 bits): specifies how long, in
seconds, datagram allowed to remain in internet. Each router
decrements TTL at least by 1 (somewhat similar to hop count)
• Protocol (8 bits):
— Indicates which next-higher-layer to receive data field at destination
• Header checksum (16 bits):
—applied to header only, because some header fields may
change during transit (e.g., time to live, fragmentation info)
—Reverified and recomputed at each router
—formed by taking ones complement of the 16-bit ones
complement addition of all 16 bit words in header
—Checksum field set to zero during calculation
36
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

18
2/14/2023

Header Fields (4)


• Source address (32 bits)
• Destination address (32 bits)
• Options (variable): encodes options requested by sending user
• Padding (variable): used to ensure that datagram
header is multiple of 32 bits in length
• Data Field
—Carries user data from next layer up
—Must be integer multiple of 8 bits long (octet)
—Max length of datagram (header + data) 65,535 octets

37
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

IPv4 Header
DiffServ Code Point
Used to label the
class of the packet

0 4 8 12 19 16
24 31
Version HLen DSCP/ECN Datagram Length
Identifier Flags Offset
TTL Protocol Checksum
Source IP Address
Destination IP Address
Options (if any, usually not)
Data
38
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

19
2/14/2023

Figure:
IPv4 Address Formats

39
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

IP Addresses - Class A
• Source & destination address fields in IP header each
contain 32-bit global Internet address
• Network part and host part
• This provides flexibility in assigning addresses to hosts
and allows mix of network sizes on internet
• Class A: Few networks, each with many hosts
—Start with binary 0
—All 0 reserved
—01111111 (127) reserved for loopback
—Range 1.x.x.x to 126.x.x.x
—All allocated
40
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

20
2/14/2023

IP Addresses - Class B
• Class B: Medium no. of networks, each with
medium no. of hosts
• Start 10
• Range 128.x.x.x to 191.x.x.x (10000000-10111111)
• Second Octet also included in network address
• So, there are 214 = 16,384 class B network addresses
• All allocated

41
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

IP Addresses - Class C
• Class C: Many networks, each with few hosts
• Start 110
• Range 192.x.x.x to 223.x.x.x(11000000-11011111)
• Second and third octet also part of network address
• 221 = 2,097,152 addresses
• Nearly all allocated
—See IPv6

42
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

21
2/14/2023

Subnets and Subnet Masks


• Consider Internet contains one or more WANs and number of
sites, each of which has number of LANs
• We would like to allow arbitrary complexity of internetworked
LANs within organization
• While insulating overall internet from growth of network
numbers and routing complexity
• One approach is let the site looks to rest of Internet like single
network
• Each LAN assigned subnet number to allow routers function
properly
• Host portion of internet address partitioned into subnet number
and host number to accommodate new level of addressing
43
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

Subnets and Subnet Masks


• Local routers route within subnetted network
• Subnet mask indicates which bits are subnet number
and which are host number
• The use of address mask allows host to determine
whether outgoing datagram is destined for host on
same LAN (send directly) or another LAN (send
datagram to router)
• Other means (e.g., manual configuration) are used
to create address masks and make them known to
local routers

44
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

22
‫‪2/14/2023‬‬

‫‪Figure:‬‬
‫‪Examples of Subnetworking‬‬

‫‪45‬‬
‫د‪/‬عزالدين محمد سويسي‪/‬كلية تقنية المعلومات‪/‬جامعة طرابلس‪ /‬ليبيا‬

‫‪IPv4 x IPv6‬‬

‫‪46‬‬
‫د‪/‬عزالدين محمد سويسي‪/‬كلية تقنية المعلومات‪/‬جامعة طرابلس‪ /‬ليبيا‬

‫‪23‬‬
2/14/2023

Required Reading
• Chapter 8 ” Computer Networks with Internet
Technology” by William Stallings
• Comer, S. Internetworking with TCP/IP,
volume 1, Prentice-Hall
• All RFCs mentioned plus any others connected with
these topics
—www.rfc-editor.org
• Loads of Web sites on TCP/IP and IP version 6

47
‫ ليبيا‬/‫جامعة طرابلس‬/‫كلية تقنية المعلومات‬/‫عزالدين محمد سويسي‬/‫د‬

24

You might also like