INTERNET PROTOCOLS
INTRODUCTION
Physical communication
Network communication model
Communication between systems
DEFINITION
What is a Communication Protocol?
A standard procedure for regulating data transmission between computers.
A system of digital rules for message exchange within or between computers.
The key elements of a protocol:
Syntax : Include time data formats and signal levels
Semantics: Includes control information and error handling.
Roles/ Functions of Protocols
1. Addressing
Network address (“Host address”)
IP or internet address (TCP/IP) (for instance 124.59.40.50)
Network service access point or NSAP (OSI)
Process within the system
Port number (TCP/IP)
Service access point or SAP (OSI)
Connection-End-Point (CEP)
Distinguish between different connections for “the same” process in a “host”.
2. Connection Control
3. Flow Control
Needed at the receiving (destination) side
Aim of this function is to avoid overwhelming slow receivers
4. Encapsulation
Addition of control information to data
Protocol control
Address information
Error-detecting code
5. Segmentation (Fragmentation), Blocking and Concatenation
Data-units in the various layers (and networks) are not necessarily of same size.
Application layer messages (files …) may be large
Network packets may be smaller
ATM blocks (cells) are 53 octets long
Ethernet blocks (frames) are up to 1526 octets long
Splitting larger blocks into smaller ones is segmentation (or fragmentation in
TCP/IP)
Sometimes the opposite happens …
Application messages are smaller than packet sizes
Advantages of fragmentation
• More equitable access to network facilities
• Smaller buffers needed (in the networks …)
• More efficient error control
Disadvantages of fragmentation
• Overheads
• More processing time
6. Transmission of data
7. Error Detection and Control
Guard against loss, damage, duplication or disordering of packets
A variety of techniques:
• Error detection
• Acknowledgment
• Retransmission techniques
Error detection
• Sender inserts error detecting bits
• Receiver checks these bits
If OK, acknowledge
If error, discard packet
8. Routing
A routing function within the (N) – layer enables communication to be relayed by a chain of
(N) – entities. An (N) – entity which participates in a routing function usually has a routing
table.
PROTOCOL LAYERING
Layering model is a solution to the problem of complexity in network protocols.
Model suggests dividing the network protocol into layers, each of which solves part of
the network communication problem.
These layers have several constraints, which ease the design problem.
Network protocol designed to have a protocol or protocols for each layer.
A. Open System Interconnection (OSI) Reference Model
The Open Systems Interconnection (OSI) model is a conceptual model that characterizes
and standardizes the internal functions of a communication system by partitioning it
into abstraction layers. The model is a product of the Open Systems Interconnection
project at the International Organization for Standardization (ISO).The model groups similar
communication functions into one of seven logical layers. A layer serves the layer above it
and is served by the layer below it.
Each layer is reasonably self-contained so that the tasks assigned to each layer can be
implemented independently. This enables the solutions offered by one layer to be updated
without adversely affecting the other layers. The following list details the seven layers of the
Open System Interconnection (OSI) reference model:
Layer 7—Application
Layer 6—Presentation
Layer 5—Session
Layer 4—Transport
Layer 3—Network
Layer 2—Data link
Layer 1—Physical
A handy way to remember this layering is:
All—Application layer
People—Presentation layer
Seem—Session layer
To—Transport layer
Need—Network layer
Data—Data link layer
Processing—Physical layer
B. Characteristics of the OSI Layers
The seven layers of the OSI reference model can be divided into two categories: upper
layers and lower layers.
The upper layers of the OSI model deal with application issues and generally are
implemented only in software.
The lower layers of the OSI model handle data transport issues. The physical layer and the
data link layer are implemented in hardware and software. The lowest layer, the physical
layer, is closest to the physical network medium (the network cabling, for example) and is
responsible for actually placing information on the medium.
Physical Layer
As the name suggests, this is the layer where the physical connection between two
computers takes place. The data is transmitted via this physical medium to the
destination's physical layer. The popular protocols at this layer are Fast Ethernet, ATM,
RS232, etc.
Data Link Layer
The main function of this layer is to convert the data packets received from the upper
layer into frames, and route the same to the physical layer. Error detection and
correction is done at this layer, thus making it a reliable layer in the model. It establishes a
logical link between the nodes and transmit frames sequentially.
Network Layer
The main function of this layer is to translate the network address into physical MAC
address. The data has to be routed to its intended destination on the network. This layer is
also responsible to determine the efficient route for transmitting the data to its destination.
While doing so, it has to manage problems like network congestion, switching problems,
etc. The protocols used here are IP, ICMP, IGMP, IPX, etc.
Transport Layer
This layer provides end-to-end delivery of data between two nodes. It divides data into
different packets before transmitting it. On receipt of these packets, the data is reassembled
and forwarded to the next layer. If the data is lost in transmission or has errors, then this
layer recovers the lost data and transmits the same.
Session Layer
This layer is responsible to establish and terminate connections between two
communicating machines. This connection is known as a session, hence the name. It
establishes full-duplex, half-duplex and simplex connection for communication. The
sessions are also used to keep a track of the connections to the web server.
Presentation Layer
The data conversion takes place at this layer. The data that it receives from the application
layer is converted into a suitable format that is recognized by the computer. For example,
the conversion of a file from .wav to .mp3 takes place at this layer.
Application Layer
This layer provides a user interface by interacting with the running application. E-mail,
FTP, web browsers, etc are the network applications that run on this layer.
C. TCP/IP Model
This model gives a brief idea about the process of data formatting, transmission, and finally
the reception. Each of these functions take place in the layers, as described by the model.
TCP/IP is a four-layered structure, with each layer having their individual protocol. Let us
have a look at the four layers:
Link Layer
As the name suggests, this layer includes the physical and logical connections from the
host's link. It is also known as Network Access layer and Network Interface layer. It
explains how the data is transmitted from the host, through the network. The physical
connectors like the coaxial cables, twisted pair wires, the optical fiber, interface cards, etc.,
are a part of this layer. This layer can be used to connect different network types like ATM,
Token ring, Ethernet, LAN, etc.
Internet Layer
This layer is also known as the Network Layer. The main function of this layer is to route
the data to its destination. The data that is received by the link layer is made into data
packets (IP datagrams). The data packets contain the source and the destination IP address
or logical address. These packets are sent on any network and are delivered independently.
This indicates that the data is not received in the same order as it was sent. The protocols
at this layer are IP (Internet Protocol), ICMP (Internet Control Message Protocol), etc.
Transport Layer
This layer is responsible for providing datagram services to the Application layer. This
layer allows the host and the destination devices to communicate with each other for
exchanging messages, irrespective of the underlying network type. Error control,
congestion control, flow control, etc., are handled by the transport layer. The protocol that
this layer uses is TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
TCP gives a reliable, end-to-end, connection-oriented data transfer, while UDP provides
unreliable, connectionless data transfer between two computers.
Application Layer
It provides the user interface for communication. This is the layer where email, web
browsers or FTP run. The protocols in this layer are FTP, SMTP, HTTP, etc.
OSI vs TCP
Transmission Control Protocol is used by Internet applications like email, World Wide Web,
FTP, etc. TCP/IP was developed by the Department of Defense (DOD) to connect various
devices to a common network (Internet). The main purpose behind developing the protocol
was to build a robust and automatically recovering phone line failure while on the battlefield.
On the other hand, Open Systems Interconnection was developed by the International
Organization for Standardization (ISO). This model was made up of two components,
namely, seven-layer model and the subset of protocols.
Both the TCP/IP and OSI model work in a very similar fashion. But they do have very subtle
differences too. The most apparent difference is the number of layers. TCP/IP is a four-
layered structure, while OSI is a seven-layered model.
Today: TCP/IP architecture is the de facto standard.
PROTOCOL CLASSIFICATION
A wide variety of communication protocols exist. They include
LAN protocols operate at the physical and data link layers of the OSI model and define
communication over the various LAN media.
WAN protocols operate at the lowest three layers of the OSI model and define
communication over the various wide-area media.
Routing protocols are network layer protocols that are responsible for exchanging
information between routers so that the routers can select the proper path for
network traffic.
Network protocols are the various upper-layer protocols that exist in a given protocol
suite.
THE PROTOCOLS
Internet protocols span the complete range of OSI model layers.
Address Resolution Protocol (ARP) Overview
For two machines on a given network to communicate, they must know the other machine’s
physical (or MAC) addresses. By broadcasting Address Resolution Protocols (ARPs), a host
can dynamically discover the MAC-layer address corresponding to a particular IP network-
layer address.
After receiving a MAC-layer address, IP devices create an ARP cache to store the recently
acquired IP-to-MAC address mapping, thus avoiding having to broadcast ARPS when they
want to re-contact a device. If the device does not respond within a specified time frame, the
cache entry is flushed.
In addition to the Reverse Address Resolution Protocol (RARP) is used to map MAC-layer
addresses to IP addresses. RARP, which is the logical inverse of ARP, might be used by
diskless workstations that do not know their IP addresses when they boot. RARP relies on
the presence of a RARP server with table entries of MAC-layer-to-IP address mappings
RARP (Reverse Address Resolution Protocol)
RARP is a protocol by which a physical machine in a local area network can request to learn
its IP address from a gateway server's Address Resolution Protocol table or cache. This is
needed since the machine may not have permanently attached disk where it can store its IP
address permanently. A network administrator creates a table in a local area network's
gateway router that maps the physical machine (or Medium Access Control - MAC) addresses
to corresponding Internet Protocol addresses. When a new machine is set up, its RARP client
program requests from the RARP server on the router to be sent its IP address. Assuming
that an entry has been set up in the router table, the RARP server will return the IP address
to the machine which can store it for future use.
TCP
The TCP provides reliable transmission of data in an IP environment. TCP corresponds
to the transport layer (Layer 4) of the OSI reference model. Among the services TCP provides
are stream data transfer, reliability, efficient flow control, full-duplex operation, and
multiplexing.
With stream data transfer, TCP delivers an unstructured stream of bytes identified by
sequence numbers. This service benefits applications because they do not have to chop data
into blocks before handing it off to TCP. Instead, TCP groups bytes into segments and passes
them to IP for delivery.
TCP offers reliability by providing connection-oriented, end-to-end reliable packet delivery
through an internetwork. It does this by sequencing bytes with a forwarding
acknowledgment number that indicates to the destination the next byte the source expects
to receive. Bytes not acknowledged within a specified time period are retransmitted. The
reliability mechanism of TCP allows devices to deal with lost, delayed, duplicate, or misread
packets. A time-out mechanism allows devices to detect lost packets and request
retransmission.
TCP offers efficient flow control, which means that, when sending acknowledgments back to
the source, the receiving TCP process indicates the highest sequence number it can receive
without overflowing its internal buffers.
IP
The Internet Protocol (IP) is a network-layer (Layer 3) protocol that contains
addressing information and some control information that enables packets to be
routed. IP is documented in RFC 791 and is the primary network-layer protocol in the
Internet protocol suite. Along with the Transmission Control Protocol (TCP), IP represents
the heart of the Internet protocols. IP has two primary responsibilities: providing
connectionless, best-effort delivery of datagrams through an internetwork; and providing
fragmentation and reassembly of datagrams to support data links with different maximum-
transmission unit (MTU) sizes.
SMTP
FTP
HTTP
ICMP
The Internet Control Message Protocol (ICMP) is a network-layer Internet protocol that
provides message packets to report errors and other information regarding IP packet
processing back to the source.
Internet Protocols Application-Layer Protocols
The Internet protocol suite includes many application-layer protocols that represent a
wide variety of applications, including the following:
• File Transfer Protocol (FTP)—Moves files between devices
• Simple Network-Management Protocol (SNMP)—Primarily reports anomalous
network conditions and sets network threshold values
• Telnet—Serves as a terminal emulation protocol
• X Windows—Serves as a distributed windowing and graphics system used for
communication between X terminals and UNIX workstations
• Network File System (NFS), External Data Representation (XDR), and Remote
Procedure Call (RPC)—Work together to enable transparent access to remote
network resources
• Simple Mail Transfer Protocol (SMTP)—Provides electronic mail services
• Domain Name System (DNS)—Translates the names of network nodes into network
addresses
ROUTERS AND ROUTING ALGORITHMS
Definition: Routing is the process of selecting best paths in a network along which to send
network traffic.
Circuit Switching - performed for many kinds of networks such as the telephone.
Packet Switching - performed in electronic data networks (such as the Internet).
Definition: A packet (datagram) is one unit of binary data capable of being routed
through a computer network.
Definition: A packet (datagram)is a segment of data sent from one computer or network
device to another computer or network device over a network
A packet contains the source, destination, size, type, data, and other useful information that
helps packet get to its destination and then read. Below is a breakdown of a TCP packet.
Parts of a typical packet
Header - The header contains instructions about the data carried by the packet. Eg
Synchronization (a few bits that help the packet match up to the network, Packet
number (which packet this is in a sequence of packets), Protocol (on networks that carry
multiple types of information, the protocol defines what type of packet is being
transmitted: e-mail, Web page, streaming video), Destination address (where the packet
is going), Originating address (where the packet came from)
Payload - Also called the body or data of a packet. This is the actual data that the packet is
delivering to the destination. If a packet is fixed-length, then the payload may
be padded with blank information to make it the right size.
Trailer - The trailer, sometimes called the footer, typically contains a couple of bits that tell
the receiving device that it has reached the end of the packet. It may also have some type of
error checking.
Delivery semantics
Routing schemes differ in their delivery semantics:
Unicast delivers a message to a single specific node
Broadcast delivers a message to all nodes in the network
Multicast delivers a message to a group of nodes that have expressed interest in
receiving the message
Anycast delivers a message to anyone out of a group of nodes, typically the one
nearest to the source
Geocast delivers a message to a geographic area
ROUTING
Routing vs routed protocols
Routing protocols – Allow routers to communicate with other routers to update and
maintain tables. Examples RIP, OSPF, EIGRP, IGRP
Routed protocols – provide information in network layer address to allow packets to be
forwarded from one host to another based on the addressing scheme. Example IP, IPX,
AppleTalk
ROUTING TABLES
A routing table, or routing information base (RIB), is a data table stored in a router or a
networked computer that lists the routes to particular network destinations, and in some
cases, metrics (distances) associated with those routes.
The routing table contains information about the topology of the network immediately
around it.
The construction of routing tables is the primary goal of routing protocols. Static routes are
entries made in a routing table by non-automatic means and which are fixed rather than
being the result of some network topology "discovery" procedure.
The routing table consists of at least three information fields:
1. the network id: i.e. the destination subnet
2. cost/metric: i.e. the cost or metric of the path through which the packet is to be sent
3. next hop: The next hop, or gateway, is the address of the next station to which the
packet is to be sent on the way to its final destination
Depending on the application and implementation, it can also contain additional values that
refine path selection:
1. Quality of service associated with the route. For example, the U flag indicates that an
IP route is up.
2. links to filtering criteria/access lists associated with the route
3. Interface: such as eth0 for the first Ethernet card, eth1 for the second Ethernet card,
etc.
TWO WAYS OF ROUTING
STATIC ROUTING (NON-ADAPTIVE ROUTING)
Routes through a data network are described by fixed paths (statically).
These routes are usually entered into the router by the system administrator
Examples: Shortest Path Algorithm
Flooding
Flow based Routing
DYNAMIC ROUTING (ADAPTIVE ROUTING)
Describes the capability of a system, through which routes are characterized by
their destination, to alter the path that the route takes through the system in
response to a change in conditions.
The adaptation is intended to allow as many routes as possible to remain valid (that
is, have destinations that can be reached) in response to the change.
There are several protocols used to achieve this:
RIP
OSPF
IS-IS
IGRP/EIGRP
Examples: Distance Vector Routing
Link State Routing
Hierarchical Routing
a) Shortest path Routing (Static Routing Example)
• Problem: Given a graph, where nodes represent routers and edges, links, find shortest
path between a given pair of nodes.
• What is shortest in shortest path?
– Depends on the routing metric in use.
– Example: number of hops (static), geographic distance (static), delay, bandwidth (raw
versus available), combination of a subset of these.
Dijkstra’s shortest-path algorithm
• Initially, links are assigned costs.
• As the algorithm executes, nodes are labeled with its distance to source along best
known path.
• Initially, no routes known, so all nodes are labeled with infinity.
• Labels change as the algorithm proceeds.
• Labels can be temporary or permanent.
– Initially all labels are tentative.
– A label becomes permanent if it represents the shortest path from the source
to the node.
b) Flooding (Static Routing Example)
• Every incoming packet forwarded on every outgoing link except the one it arrived on.
• Problem: duplicates.
• Constraining the flood:
• Hop count.
• Keep track of packets that have been flooded.
• Robust, shortest delay (picks shortest path as one of the paths).
Distance Vector Routing (aka Bellman-Ford, Ford-Fulkerson) (Dynamic Routing
Example)
Aka, Bellman-Ford (1957), Ford-Fulkerson (1962).
Original ARPANET routing; also used by Internet’s RIP.
Each router keeps routing table (or routing vector) with best known distance to each
destination and corresponding outgoing interface.
Routing tables are updated by exchanging routing information with neighbors.
Routing table at each router:
One entry per participating router.
Each entry contains outgoing interface and distance to corresponding destination.
Metric: number of hops, delay, queue length.
Each router knows distance to its neighbors.
Old ARPANET algorithm: DV where cost metric is outgoing link queue length.
• Every T interval, routers exchange routing updates.
• Routing update from router X consists of a vector with all destinations and the
corresponding distance from X to them.
• When router Y receives an update from X, it can estimate its distance to router Z
through X as Dyz = Dyx + Dxz.
• Router Y receives update from all its neighbors and builds a new RT.