IP Protocol xxOK
IP Protocol xxOK
CS641
Computer Networking
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
3
2/14/2023
Figure:
Internet Protocol Operation
7
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
8
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
4
2/14/2023
5
2/14/2023
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
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
ليبيا/جامعة طرابلس/كلية تقنية المعلومات/عزالدين محمد سويسي/د
17
2/14/2023
18
2/14/2023
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
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