You are on page 1of 66

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…
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 IPV4 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
Figure: IP datagram
• 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
Exercise:
1. Please explain in detail the Header Fields of IPv6
2. Compare and contrast IPV4 and IPV6

Figure: IP Ver6 Headers


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
60
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
61
Figure 2-7

Chapter 2 Protocols and the TCP/IP


Suite
62
Figure 2-8

Chapter 2 Protocols and the TCP/IP


Suite
63
Figure 2-9

Chapter 2 Protocols and the TCP/IP


Suite
64
Figure 2-10

Chapter 2 Protocols and the TCP/IP


Suite
65
Thank you

You might also like