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

Lecture 2 and 3

The document discusses protocols and layered protocol architectures. It covers: 1. The need for protocol architectures to partition complex communication tasks across hierarchical layers to simplify development and allow independence between layers. 2. Examples of layered models including a simple 3-layer model for file transfer and the 4-layer TCP/IP model. 3. An overview of the TCP/IP protocol suite, including the roles of IP, TCP and UDP in addressing, encapsulation, routing, reliability and connection-oriented vs connectionless communication.

Uploaded by

Abraham Gadissa
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)
26 views

Lecture 2 and 3

The document discusses protocols and layered protocol architectures. It covers: 1. The need for protocol architectures to partition complex communication tasks across hierarchical layers to simplify development and allow independence between layers. 2. Examples of layered models including a simple 3-layer model for file transfer and the 4-layer TCP/IP model. 3. An overview of the TCP/IP protocol suite, including the roles of IP, TCP and UDP in addressing, encapsulation, routing, reliability and connection-oriented vs connectionless communication.

Uploaded by

Abraham Gadissa
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/ 99

Protocols and Architecture

Lecture 2
Contents
• Introduction: the need for protocol architecture
• Layered protocol architecture
• TCP/IP protocol suite
• OSI reference model
• Internetworking
2.1 The need for a Protocol
Architecture
Definition
• Protocol is a set a rules or conventions for two or more systems to
successfully communicate
• The need for Protocol Architecture
– Procedures to exchange data between devices is complex
– High degree of cooperation required between communicating systems
Protocol Hierarchies: sets of step by step
• The reason of hierarchies
– The communication task is too complex to be handled as one unit.
• The way of hierarchies
– Partition into a vertical set of layers
– Each layer performs a related subset of the functions
– Provides services to the next higher layer and
– Relies on the next lower layer to perform primitive function
– Defined so that changes in one layer do not require changes in other
layer.
Key Features of a Protocol
• Set of rules or conventions to exchange blocks of formatted
data
• Syntax : Data format, coding, and signal level
• Semantics: Control information for coordination and
error handling
• Timing: Speed matching and sequencing
Why layering?
• To prevent well-defied interfaces between
adjacent layers
– A change in one layer does not affect the other
layers
– Interface must remain the same
• Allows a structured development of network
software
2.2 A Simple Protocol Architecture
Con…
• In case of File Transfer application, the
communication task can be organized into
three independent layers:
• For example file transfer could use three
modules
– File transfer application
– Communication service module
– Network access module
Con…
• Network Access Layer:
– Exchange data between a computer and the
network
• Transport Layer:
– A common layer which has the mechanisms to
provide reliable data transfer
• Application Layer
– Contains the logic to support the various user
applications
Con…

Figure: Protocols in a Simplified


Architecture
Con…
Addressing:
Two levels of addressing are needed
• Each computer on the network has unique
network address
• Each application has an address that is
unique with that computer (SAP)
Con…
Protocol Data Unit (PDU)
• The combination of data and control information is
a protocol data unit (PDU)
• Typically control information is contained in a
PDU header
– control information is used by the peer transport
protocol at computer B
• Headers may include:
– Source port,
– Destination port,
– Sequence number, and
– Error-detection code
Con…
Network Access Protocol
• After receiving segment from transport layer,
the network access protocol must request
transmission over the network
– The network access protocol creates a network
access PDU (packet) with control information
• Header includes:
– Source computer address
– Destination computer address
– Facilities requests
2.3 Simplified 4-layer model

Runs on top of layers 1, 2 and 3


End –to-end message transfer

Packet delivery across internet

Frame transmission over link


• Data flow in 4 layer model
2.4 TCP/IP Protocol Suite
• Refers to a family of protocols (TCP/IP comprises a
large collection of protocols that are internet
standards)
• The protocols are built on top of connectionless
technology
– Data sent from one node to another as a sequence of
datagrams
– Each datagram sent independently
– The datagram corresponding to the same message may
follow different routes
• Variable delay, arrival order at destination
Con…
• TCP/IP allows computers to communicate/share
resources across a network
• TCP/IP protocol came from ARPANET by ARPA.
– Result of protocol research and development
conducted on ARPANET
• The modern internet sits on top of the TCP/IP
technology
– Used as standard
– To bridge the gap between non-compatible platforms
– All computers connected to the internet understands
TCP/IP
TCP/IP operation
• Process associated with port 3 in host A sends
message to port 1 in host B
• Process at A hands down message to TCP to
send to port 1
• TCP hands down to IP to send to host B
• IP hands down to network layer (e.g. Ethernet)
to send to router J
• Generates a set of encapsulated PDUs
Con…
TCP/IP family members
• Typical scenario
What does IP do in TCP/IP protocol?
• IP transports datagrams (packets) from the
source node to the destination node
• Responsible for routing the packets
• Breaks a packet into smaller packets, if
required
• Unreliable service
– A packet may be lost in transmit
– Packets may arrive out of order
– Duplicate packets may be generated
What does TCP do in TCP/IP protocol?

• TCP provides a connection-oriented reliable


service for sending messages
– Split a message into packets
– Reassemble packets at destination
– Resend packets that were lost in transit
• Interface with IP
– Each packet forwarded to IP for delivery
– Error control is done by TCP
What does UDP do in TCP/IP protocol?

• UDP (User Datagram Protocol) provides a


connectionless, unreliable service for sending
datagram (packets )
• Not guaranteed delivery, No preservation of
sequence, No protection against duplication
– Message small enough to fit in a packet (e.g .. DNS
query)
– Simpler(and faster) than TCP
– Never split data into multiple packets
– Does not care about error control
• Interface with IP
– Each UDP packet sent to IP for delivery
TCP/IP Address Requirements
• Two levels of addressing are needed:
– Each host on a sub network must have a unique
global internet address
– Each process with a host must have an address
(known as a port) that is unique within the host
Con…

Port Address (16 bits)

Internet Address (32 bits)

Physical Address (48 bits)


Encapsulation
• Basic concept
– As data flows down the protocol hierarchy, headers
(and trailers) get appended to it
– As data moves up the hierarchy, headers(and
trailers) get stripped off
• An example to illustrate
– Trivial file transfer protocol (TFTP)
– TFTP client transfers 200 bytes of data
– 4 bytes of TFTP header gets added
Figure: Protocol Data units (PDU) in the TCP/IP Architecture
Encapsulation in TFTP
The IP layer
• IP layer provides a connectionless,
unreliable delivery system for packets
• Each packet is independent of one
another
– IP layer need not maintain any history
– Each IP packet must contain the source and
destination address
– The IP layer doesn’t guarantee delivery of
packets
• IP layer encapsulation
– Receives a data chunk from the higher layer(TCP
or UDP)
– Prepends a header of minimum 20 bytes
• Containing relevant information for handling routing
and flow control
Format of IP Datagram
IP Header Fields
• VER (4 bits)
– Version of the IP protocol
• HLEN (4 bits)
– Length of header, expressed as the number of 32
bit words
• Total Length (16 bits)
– Length in bytes of the datagram, including header
– Maximum datagram size = 216 = 65536 bytes
Con….
• Service type (8 bits)
– Allows packet to be assigned a priority
– Router can use this field to route packets
– Not universally used
• Time to live (8 bits)
– Prevents a packet from traveling in a loop
– Senders sets a value, that is decremented at each
hop. If it reaches zero, packet is discarded
• Protocol (8 bits)
– Identifies the higher layer protocol being used
• Source IP address (32 bits)
– Internet address of the sender
• Destination IP address (32 bits)
– Internet address of the destination
• Identification, flags, fragment offset
– Used for handling fragmentation
• Options (variable width)
– Can be given provided router supports
– Source routing for example
• Header checksum (16 bits)
– Convers only IP header
– how computed?
• Header treated as a sequence of 16 bits integers
• The integers are all added using once
complement arithmetic
• Once complement of the final sum is taken as
the checksum
– A mismatch in checksum causes the
datagram to be discarded
Fragmentation header
• If the packet size exceeds a certain maximum
value, it is split into tow or more fragment
packets
• The fragments are reassembled at some later
stage
How fragmentation is done?
• The different networks are connected among
themselves through routers
• Allow the routers to break the packets into
fragments, if necessary.
• Each fragment is transmitted as a separate IP
packet
• The fragments need to be reassembled back
• For reassembly of fragments, there are two
alternatives
– Transparent fragmentation
– Non-transparent fragmentation
Figure: interconnection of networks
Transparent fragmentation
• Fragmentation is made transparent to subsequent
network, through which the packet pass
• Basic concept
– An oversized packet reaches a router
– Router breaks it up into fragments
– All fragments sent to the same exit router (say, Rg)
– Rg reassembles the fragments before forwarding to the next
network
• Why called transparent ?
– Subsequent networks are not even aware the as
fragmentation had occurred
• A packet may get fragmented several times on its way
to the final destination
Figure: Transparent fragmentation
Drawbacks of transparent fragmentation
• All packets must be routed via the same exit
router
• Exit router must know when all the pieces
have been received
– Either a “count” field or “end-of-packet” field
must be stored in each packet
• Lot of overhead
– A large packet may be fragmented and
reassembled repeatedly
Non-Transparent Fragmentation
• Fragmentation is not transparent to subsequent
networks
• Basic concept
– Packet fragments are not reassembled at any
intermediate router
– Each fragment is treated as an independent packet
by the router
– The fragments are reassembled at the final
destination host
Figure: Non-transparent Fragmentation
• Advantages
– Multiple exit routers may be used
– Higher throughput
• Drawback
– When a large packet is fragmented, overhead
increase
– Each fragment must have a header (minimum 20
bytes )
• IP protocol uses non-transparent fragmentation
Lecture 3
Fragment reassemble

Figure: IP datagram
Fragment reassemble cont.…
• How fragment reassemble is done at
destination side ?
– To allow fragment reassembly at the final
destination, IP uses the following fields in the
header
– Identification (16 bits)
• A datagram id set by source
– Fragment offset (13 bits)
• Indicates where in the original datagram this
fragment belongs to
• Specified in multiple of 8 bytes
Flags (3 bits)
• Two flags are defined
– 0 bit: don’t fragment; prevents fragmentation
from taking place
– M bit: more fragment: specifies if this
fragment is the last one in the original
packet or not
Example of IP fragmentation

N1 N1
1000 bytes
data
MTU = MTU =
620 bytes 400 bytes
Example Con…

ID =5, FO= 0, M=0 20 1000

ID =5, FO= 0, M=1 ID =5, FO= 75, M=0


20 600 20 400
By N1

ID =5, FO= 0, M=1 ID =5, FO= 122, M=0


20 376 20 224 20 376 20 24
By N2
ID =5, FO= 47, M=1 ID =5, FO= 75, M=1

1020 bytes sent and 1080 bytes received


IP version (Ipv6)
IP versions
• IP V1-3 defined and replaced
• IP V4 – current version
• IP V5 –streams protocol
• IP V6 – replacement for V4, during
development it was called IPng (IP Next
generation)
Motivation for IP V6
• There are 32 bits in address field of Ipv4.
However, the address space might not be
adequate for the future Internet.
• New requirements in the area of address
configuration, routing flexibility, and traffic
support had been defined.
Motivation for IP V6 con…
Why change IP
• Address space exhaustion:
– Two level addressing (network and host) wastes space
– Network addresses used even if not connected
– Growth of networks and the internet
– Extended use of TCP/IP
– single address per host
• Requirements for new types of services
– Address configuration routing flexibility
– Traffic support
History of IP V6
• July 1992: Internet Engineering Task Force(IETF)
• Call for proposal for Next Generation IP (IPng)
• 1994: Final design for Next Generation IP (IPng)
• January 1995: Publication of RFC1732
• The Recommendation for the IP Next Gene ration
Protocol
• Now, the protocol is called Ipv6
• RFC2460: Overall Specification of Ipv6
• RFC2373: Address Structure of Ipv6
Enhancement of Ipv6 over Ipv4
• Expanded Address space
– IPv6 uses 128 bit addresses instead of 32 bit addresses
of IPv4.
• Improved Option Mechanism
– IPv6 options are placed in separate optional header
between IPv6 header and transport layer header.
• Dynamic Address Assignment (Address auto
configuration
– Provide for dynamic assignment of IPv6 addresses.
• Increased addressing flexibility
– The concept of any cast address is included.
– Multicast routing is improved by adding a scope field
Enhancement of Ipv6 over Ipv4
cont.….
• Support for resource allocation
– Instead of type of service field in IPv4, IPv6
enables the labeling of packets to a particular
traffic flow.
Ipv6 Structure
• An IPv6 protocol data unit(packet) has the following
general form:

Figure: IP Ver6 Headers


Optional Extension Headers
• Hop by Hop Option header
– Defines special options that require hop by hop processing.
• Routing header
– Provide extended routing, similar to IPv4 source routing.
• Fragment header
– Contains fragmentation and reassembly information.
• Authentication header
– Provide packet integrity and authentication.
• Encapsulation Security Payload header
– Provide privacy.
• Destination Options header
– Contains optional information to be examined by the
destination node.
Ipv6 Header
• The IPv6 header has a fixed length of 40 octets.
• Version (4 bits):
– IP version number; the value is 6.
• DS/ECN (8 bits):
– Available for use by originating nodes and/or
forwarding routers for differentiated services and
congestion functions, as described for the IPv4
DS/ECN field.
• Flow Label (20 bits),
– Contains fragmentation and reassembly information.
• Payload Length (16 bits)
– Provide packet integrity and authentication.
Ipv6 Header cont.…
• Next Header (8 bits)
– Provide privacy.
• Hop Limit (8 bits)
– Contains optional information to be examined by the
destination node.
• Source Address (128 bits)
– Provide extended routing, similar to IPv4 source
routing.
• Destination Address (128 bits)
– Contains fragmentation and reassembly information.
Ipv6 Header cont.…
Ipv6 Addresses
• 128 bits in length Addresses are assigned to
individual interfaces on nodes.
• Ipv6 allows 3 types of addresses
– Unicast : an interface for a single node
– Anycast : an identifier for a set of interfaces
– Multicast : an identifier for a set of interfaces
Exercise:
1. Please explain in detail the Header Fields of IPv6
2. Compare and contrast IPV4 and IPV6
TCP and UDP
Introduction
• In TCP/IP, the transport layer consists of two
different protocols
– Transmission control protocol (TCP),
– User datagram protocol (UDP)
• Basic Idea:
– User processes (applications ) interact with the TCP/IP
protocol suite by sending/receiving TCP or UDP data
– Both TCP and UDP in turn users the IP layer for
delivery of packets
Role of TCP
• Provides a connection-oriented, reliable,
full-duplex, byte-stream service
– Underlying IP layer is unreliable and
provides connectionless delivery service
– TCP provides end-to-end reliability using
• Checksum
• Positive acknowledgments
• Timeouts
• End-to-end flow control
Role of TCP con…
• TCP also handles
– Establishment and termination of connections
between processes
– Sequencing of data that might reach the
designation in any arbitrary order
Role of UDP
• Provides a connectionless and unreliable
datagram service
– Very similar to IP in this respect
– Provides two feature that are not their in IP
• A checksum to verify the integrity of the UDP packet
• Port numbers to identify the process at the two ends
Port numbers
• Multiple user processes on a machine may use
TCP or UDP at the same time
• There is need for a mechanism to uniquely
identify the data packets associated with each
process
• How this is done?
– Both TCP and UDP uses 16 bits integer port numbers
– Different applications are identified by different port
numbers
– Port numbers are stored in the headers of TCP or UDP
packets
Port numbers con..
Port numbers con..

Port Address (16 bits)

Internet Address (32 bits)

Physical Address (48 bits)


Port numbers con..
• Client-server scenario
– By knowing the 32-bit IP address of the server
host, a client host can connect to the server
– To identify a particular process running on the
server host, the client must also know the
corresponding port number
• Well-known port numbers
– Predefined, and publicly known
– FTP uses port 21, SMPT uses port 25
Ephemeral port numbers
• A typical scenario
– A client process sends a message to a server
process located on some host at port 1534
– How will the server know where to
respond?
• Client process request on unused port number
from the TCP/UDP module on it local host
• These are temporary port numbers called
ephemeral port numbers
• Send along with TCP or UDP header
Ephemeral port numbers cont.….
• How are the port numbers assigned ?
– Port numbers from 1 to 1023 are reserved for well-
known ports
• Has been extended to 4095
– Numbers beyond this range and up to 6535 are
used as ephemeral port numbers
Connection Establishment
• A hierarchical addressing scheme is used to define a
connection path between two hosts
– IP address
• Identifies the communicating hosts
– Protocol identifier
• Identifies the transport layer protocol being
used (TCP, UDP or anything else)
– Port numbers
• Identifies the communicating processes in the
two hosts
Association
• A set of five values that describe a unique
process-to-process connection is called an
association
– The protocol (TCP or UDP)
– Local host IP address (32-bit value)
– Local port number (16-bit value)
– Remote host IP address (32-bit value)
– Remote port number (16-bit value)
TCP Encapsulation

Format of TCP segment


TCP header fields
• Source port (16 bits)
– Identifies the process at the local end
• Destination port (16 bits)
– Identifies the process at the remote end
• Sequence number (32 bits)
– Used for reliable delivery of message
– Each byte of message is assigned a 32 bit number
that is incremental sequentially
– The field holds the number of the first byte in the
TCP segment
TCP header fields cont.…
• Acknowledgement number (32 bits)
– Used by remote host to acknowledge receipt of
data
– Contains the number of the next byte expected to
be received
• HLEN(4 bits)
– Specifies the header length in number of 32 bit
words
TCP header fields cont.…
• Flags (6 bits )
– There are six flags
• URG is set to 1 if the urgent pointer is in use
• A connection request is sent by making SYN =1 and
ACK = 0
• A connection is confirmed by sending SYN=1 and ACK
=1
• When the sender has no more data, FIN=1 is sent to
release the connection
• RST bit is used to reset a connection. It is also used to
reject a connection attempt
• PSH bit indicates the push function used to indicate end
of messages
TCP header fields cont.…
• Window (16 bits)
– Specifies how many bytes may be sent
beyond the bytes acknowledged
– This number, called window advertisement,
can increase or decrease as needed
– A value of zero closes the window
altogether
TCP header fields cont.…
• Checksum (16 bits)
– Applies to the entire segment and pseudo-header
– The pseudo-header contains following IP headers
fields:
• Source IP address, destination IP address, protocol,
segment length
• TCP protects itself from misdelivered by IP (delivered
to wrong host)
– Same algorithm as used in IP
Format of UDP header
UDP header fields
• Source port (16 bits)
– Identifies the process at the local end
• Destination port (16 bits)
– Specifies the size of the datagram in bytes (UDP
header plus data)
• Checksum (16 bits)
– Computed in the same way as TCP
– This is optional: set to zero if not used
The OSI Model
• Open Systems Interconnection
• Developed by the International Organization for
Standardization (ISO)
• Seven layers
• A theoretical system delivered too late!
• TCP/IP is the de facto standard
– `framework for standardization was motivator
– lower layers are concerned with greater levels of details
– each layer provides services to the next higher layer
– three key elements:
• Protocol Specification
• Service Definition
• Addressing
Figure: A1 OSI Reference Model
Figure : A2 A Comparison of the OSI and TCP/IP
No. Concerned with transmission of unstructured bit stream over physical medium;
Physical deals with the mechanical, electrical, functional, and procedural characteristics
to access the physical medium

2 Provides for the reliable transfer of information across the physical link; sends blocks
Data link of data(frames) with the necessary synchronization, error control, and flow control

3 Provides upper layers with independence from the data transmission and switching
Network technologies used to connect systems; responsible for establishing, maintaining, and
terminating connections
4 Provides reliable, transparent transfer of data between end points, provides the
Transport control structure for communication between applications; establishes, manages, and
terminates connections(sessions) between cooperating applications

5 Provides the control structure for communication between applications;


Session establishes, manages, and terminates connections (sessions) between
cooperating applications
Presentation Provide independence to the application processes from differences in data
representation (syntax)
Application Provides access to the OSI environment for users and also provides
Internetworking Terms
• Communication network
• Internet
• Intranet
• Subnetwork
• End system
• Intermediate system
• Bridge
• Router

Chapter 2 Protocols and the TCP/IP


Suite
93
Routers
• Provide link between networks
• Accommodate network differences:
– Addressing schemes
– Maximum packet sizes
– Hardware and software interfaces
– Network reliability

Chapter 2 Protocols and the TCP/IP


Suite
94
Figure 2-7

Chapter 2 Protocols and the TCP/IP


Suite
95
Figure 2-8

Chapter 2 Protocols and the TCP/IP


Suite
96
Figure 2-9

Chapter 2 Protocols and the TCP/IP


Suite
97
Figure 2-10

Chapter 2 Protocols and the TCP/IP


Suite
98
Thank you

You might also like