Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Computer Networking

Chapter two

Network Categories and OSI


Architecture
Basics of networking
A network is a set of devices (often referred to as nodes) connected by
communication links( transmission system).
Computer networking is a system in which a number of independent
computers are linked together to share data and peripherals.
Purpose of Networking
 Data: documents, photographs, video and audio files
 Hardware: Printers, Fax machines, Modems
 Software : Word-processing software, other application software .
 Centralizing administration and support: email message, Project-tracking software, Live audio and
video broadcasts.

Categories of Networks
 Size: LAN, MAN, WAN
LAN is confined to limited geographical area , one type of transmission medium,
speeds between 100-1000Mbs , coverage few kilometers
WAN : large geographical area coverage eg. Internet
MAN: size b/n LAN and WAN, usually inside town or city .

 Function : Peer-to-Peer , Client -server


Categories of networking …
 Peer to Peer networks
 Each PC acts as an independent workstation and maintaining its own security that stores data on its own
disk but which can share it with all other PCs on the network.
 no master or controller or central server
 It is suitable for small networks up 10 PCs

Advantages Disadvantages
Use less expensive computer hardware Not very secure
Easy to administer, setup and low cost No central point of storage or file archiving
No NOS required Additional load on PC b/c of resource sharing
More built in redundancy Hard to maintain version control

 Client –Server
 Certain computers act as server and other act as clients
 Server is a computer which provides service to other computers
 Client is a computer which requests a service .
Advantages Disadvantages
Very secure requires professional administration
Better performance More hardware-intensive
Centralized backup More software intensive
very reliable Expensive dedicated software
Network Model:

 A method of describing and analyzing data communication


networks by breaking the entire set of communication
process into a number of layers.

 Each layer has a specific function.


The OSI Model:

 International standard organization (ISO) established a


committee in 1977 to develop an architecture for systems
communication.

 Open System Interconnection (OSI) reference model is the


result of this effort.

 This model allows any two different systems to communicate


regardless of their underlying architecture.
Cntd..
 The OSI model describes how data flows from one computer,
through a network to another computer.

 The OSI model is not a protocol: it is a model for


understanding and designing a network architecture that is
flexible and robust.

 The OSI model consists of seven separate but related layers,


each of which defines a part of the process of moving
information across a network.
Seven layers of the OSI model:
Why so many layers?

 To reduce the complexity, networks are organized as a stack


of layers, one below the other.

 Each layer performs a specific task,. It provides services to an


adjacent layer.
Packets

 A small chunk of data transmitted over the


Internet

Alice Bob

The
Intern
An exchange using the OSI model:
Physical Layer:

 Physical layer is the bottom(layer1) of OSI model.

 It is responsible for the actual physical connection between


the devices.

 The physical layer is responsible for movements of individual


bits from one node to next.
Physical layer
Functions of Physical Layer:

 Convert bits to signals


 Bit synchronization: The sender and the receiver clocks must be
synchronized
 Manage physical connection
 Bit rate control: i.e the number of bits sent each second
 Line configuration: point-to-point configuration, or a multipoint configuration.
 Physical topology: how devices are connected
 Transmission mode :i.e. Simplex, half-duplex, or full-duplex.
 Multiplexing
 Switching
Data Link Layer:

 The data link layer is responsible for moving frames from one
node to the next.
Functions of Data Link Layer:
 Framing:- divides the data from N/W layer into frames.

 Physical Addressing:- Add a header to the frame to define the


physical address of the source and the destination machines.

 Flow Control:- It is the traffic regulatory mechanism implemented


by Data Link layer that prevents the fast sender from drowning the
slow receiver.

 Error Control:- It provides the mechanism of error control in


which it detects and retransmits damaged or lost frames.

 Feedback:- after transmitting the frames, the system waits for the
feedback.
Network Layer:
Functions of Network layer:
 It is responsible for the source to destination delivery of a
packets across multiple networks.

 Routing:- Provide mechanism to transmit data over


independent networks that are linked together.

 Logical addressing:- Adds Logical addresses of sender and


Receiver.
Transport Layer:

 It is responsible for source process to destination process


delivery of entire message.
Cntd…
 Transport layer provides two types of services:

1) Connection Oriented Transmission: In this type of


transmission the receiving device sends an acknowledgment
back to the source after a packet or group of packet is
received.

2) Connectionless Transmission: In this type of transmission


the receiver does not acknowledge receipt of a packet.
Functions of Transport Layer:
 Segmentation and Reassembly: Divide the message received
from Session layer into Segments and number them to make a
sequence for reassembly at the receiving side.

 Service point addressing: Transport layer makes sure that the


message is delivered to the correct process on destination
machine.

 Error Control: Make sure that the entire message arrives


without errors else retransmit.

 Flow Control: Transport layer makes sure that the sender


and the receiver communicate at a rate they both can handle.
Session Layer:

 It is responsible for beginning, maintaining & ending the


communication between two devices, which is called session.
Functions of Session Layer:
 Establishment, maintaining and ending a session:
 Sends SYN packet – establish request
 Receives ACK & SYN- established
 To end – Sender sends ACK

 Dialog Control: The session layer allows two systems to


enter into a dialog.

 Synchronization: Allows a process to add checkpoints to a


stream of data.
Presentation Layer:

 This layer is concerned with the syntax and semantics of the


information exchanged between two systems.
Functions of Presentation Layer:

 Data Translation: Encoding and Decoding


Sender to Common format on Sending side
Common to Receiving format on Receiver side

 Data Encryption: For security and privacy purpose.

 Data Compression: Data compression reduces the number


of bits contained in the information.
Application Layer:

 Provides User interfaces and support for Services, like e-mail,


file transfer.
Functions of Application Layer:
 Network Virtual terminal: It allows a user to log on to a
remote host.

 File Transfer Access, and Management: This application allows


a user to access files in a remote host.

 Mail Services: This application provides various e-mail


services.

 Directory Services: This application provides the distributed


database sources and access for global information about
various objects and services.
Summary of OSI Model

Summary of OSI Model


TCP/IP Model:
 A family of protocols that makes the Internet works.
 These protocols, which are implemented on both the sending and
receiving hosts, interact to provide end-to-end delivery of applications
over a network.
TCP/IP cont…
 A complete communication process includes these steps:

 Creation of data
 Segmentation and encapsulation
 Generation of the data onto the media at the network access layer of
the stack.
 Transportation of the data through the internetwork.
 Reception of the data at the network access layer of the destination
end device.
 Decapsulation and reassembly of the data as it passes up the stack in
the destination device.
 Passing this data to the destination application layer .
TCP/IP (cont)
 All the above process have been shown in figure
TCP/IP (cont’)
 Protocol Data Unit (PDU). The form that a piece of data takes at
any layer. At each stage of the process, a PDU has a different name
to reflect its new appearance.
 Data: The general term for the PDU used at the Application layer
 Segment: Transport Layer PDU
 Packet: Internetwork Layer PDU
 Frame: Network Access Layer PDU
 Bits: A PDU used when physically transmitting data over the
medium
Application Layer:
 This layer is the combination of Application, Presentation and
Session layer of the OSI model.
 This layer provides various services to different user
applications.
 Application layer includes several high-level protocols that are
used for wide variety of applications like:
 TELNET(Terminal Network): Used for remote login.
 FTP(File Transfer Protocol): For transfer of file from one
system to another.
 HTTP(Hyper Text Transfer Protocol): For fetching web
pages on world wide web(www).
Transport Layer:

 Transport layer is similar in functionality to transport layer of


OSI model.

 Transport layer of TCP/IP model also provides connection


oriented and connectionless services.

1) Connection Oriented – TCP(Transmission Control Protocol)


2) Connection Less – UDP(User Datagram Protocol)
Transport Layer ( TCP & UDP) cont..
1) TCP
 Transport layer used TCP for reliable connection oriented service.

 The various functions of TCP are :


1) Error Control 2) Flow Control 3) Sequencing
2)UDP
 Transport layer used this protocol for unreliable connectionless service.

 No assurance that packet reached.

 No sequencing & No error checking

 Useful in real time data transfer and quick transfer of large data.

 It follows that delivery is more important than accurate delivery.


Internet Layer:

 Internet layer is similar to network layer of OSI model in


functionality.
 This layer is responsible for delivering IP packets to their
destinations.
 An important protocol of this layer is IP(Internet Protocol).
 It is an unreliable and connectionless protocol.
 IP transports data in packets called datagrams.
 IP does not keep track of the routes.
Internet Protocol(IP) Datagram:
Host to Network Layer:

 It is the bottom layer of TCP/IP model also known as


Network interface layer.

 The purpose of this layer is to connect the host to the


network.
Host to Network Layer:

 It is the bottom layer of TCP/IP model also known as


Network interface layer.

 The purpose of this layer is to connect the host to the


network.
Differences between OSI & TCP/IP:

 OSI model has seven layers.


 TCP/IP has four layers.
 OSI model provides clear distinction between services, interfaces and
protocols.
 TCP/IP doesn’t provide clearly distinguish between services, Interfaces
and protocols.
 In OSI model transport layer is connection oriented.
 In TCP/IP transport layer is both connection oriented and
connectionless.
Differences between OSI & TCP/IP(cont)

 In OSI Data Link layer and Physical layer are separate layers.
 In TCP Data Link layer and Physical layer are combined as one
in Host-to-Network layer.

 Protocols do not fit well into the OSI model.


 Protocols fit well in TC/IP model.

 Minimum size of OSI header is 5 bytes.


 In TCP/IP minimum size of the header is 20 bytes.
Flow and Error Control Techniques
Flow Control
• Flow control coordinates the amount of data that can be sent
before receiving acknowledgement.
• Flow control is a set of procedures that tells the sender how
much data it can transmit before it must wait for an
acknowledgement from the receiver.
• Receiver has a limited speed at which it can process incoming
data and a limited amount of memory in which to store
incoming data.
• Receiver must inform the sender before the limits are reached
and request that the transmitter to send fewer frames or stop
temporarily.
• Since the rate of processing is often slower than the rate of
transmission, receiver has a block of memory (buffer) for
storing incoming data until they are processed.
• In the absence of flow control, the receiver’s buffer may fill up
and overflow while it is processing old data.
Error Control
• Error control includes both error detection
and error correction.
• It allows the receiver to inform the sender if a
frame is lost or damaged during transmission
and coordinates the retransmission of those
frames by the sender.
• Error control in the data link layer is based
on automatic repeat request (ARQ).
Whenever an error is detected, specified
frames are retransmitted.
Error and Flow Control Mechanisms

 Stop-and-Wait
 Go-Back-N ARQ
 Selective-Repeat ARQ
Sender keeps a copy of the last frame
Stop-and-Wait

until it receives an acknowledgement.


 For identification, both data frames
and acknowledgements (ACK) frames
are numbered alternatively 0 and 1.
 Sender has a control variable (S) that
holds the number of the recently sent
frame. (0 or 1)
 Receiver has a control variable (R)
that holds the number of the next
frame expected (0 or 1).
 Sender starts a timer when it sends a
frame. If an ACK is not received within
a allocated time period, the sender
assumes that the frame was lost or
damaged and resends it
 Receiver send only positive ACK if
the frame is intact.
 ACK number always defines the
number of the next expected frame
Stop-and-Wait ARQ, lost frame

 When a receiver
receives a damaged
frame, it discards it
and keeps its value
of R.
 After the timer at the
sender expires,
another copy of
frame 1 is sent.
Stop-and-Wait, lost ACK frame

• If the sender
receives a damaged
ACK, it discards it.
• When the timer of
the sender expires,
the sender
retransmits frame 1.
• Receiver has
already received
frame 1 and
expecting to receive
frame 0 (R=0).
Therefore it
discards the second
copy of frame 1.
Stop-and-Wait, delayed ACK frame
• The ACK can be
delayed at the
receiver or due to
some problem
• It is received after the
timer for frame 0 has
expired.
• Sender retransmitted
a copy of frame 0.
However, R =1 means
receiver expects to
see frame 1. Receiver
discards the duplicate
frame 0.
• Sender receives 2
ACKs, it discards the
second ACK.
Piggybacking
• A method to
combine a data
frame with ACK.
• Station A and B
both have data to
send.
• Instead of sending
separately, station A
sends a data frame
that includes an
ACK.
• Station B does the
same thing.
• Piggybacking saves
bandwidth.
Disadvantage of Stop-and-Wait
• In stop-and-wait, at any point in time, there
is only one frame that is sent and waiting to
be acknowledged.
• This is not a good use of transmission
medium.
• To improve efficiency, multiple frames should
be in transition while waiting for ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ
Go-Back-N ARQ

 We can send up to W frames before


worrying about ACKs.
 We keep a copy of these frames until the
ACKs arrive.
 This procedure requires additional
features to be added to Stop-and-Wait
ARQ.
Sequence Numbers
• Frames from a sender are numbered sequentially.
• We need to set a limit since we need to include
the sequence number of each frame in the
header.
• If the header of the frame allows m bits for
sequence number, the sequence numbers range
from 0 to 2 m – 1. for m = 3, sequence numbers
are: 1, 2, 3, 4, 5, 6, 7.
• We can repeat the sequence number.
• Sequence numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, …
Sender Sliding Window
• At the sending site, to hold
the outstanding frames
until they are
acknowledged, we use the
concept of a window.
• The size of the window is
at most 2m -1 where m is
the number of bits for the
sequence number.
• Size of the window can be
variable, e.g. TCP.
• The window slides to
include new unsent frames
when the correct ACKs are
received
Receiver Sliding Window
• Size of the window at the
receiving site is always 1
in this protocol.
• Receiver is always looking
for a specific frame to
arrive in a specific order.
• Any frame arriving out of
order is discarded and
needs to be resent.
• Receiver window slides as
shown in fig. Receiver is
waiting for frame 0 in
part a.
Control Variables
• Sender has 3 variables: S, SF, and SL
• S holds the sequence number of recently sent frame
• SF holds the sequence number of the first frame
• SL holds the sequence number of the last frame
• Receiver only has the one variable, R, that holds the sequence
number of the frame it expects to receive. If the seq. no. is the
same as the value of R, the frame is accepted, otherwise rejected.
Acknowledgement
 Receiver sends positive ACK if a frame arrived safe and in order.
 If the frames are damaged/out of order, receiver is silent and discard all
subsequent frames until it receives the one it is expecting.
 The silence of the receiver causes the timer of the unacknowledged
frame to expire.
 Then the sender resends all frames, beginning with the one with the
expired timer.
 For example, suppose the sender has sent frame 6, but the timer for
frame 3 expires (i.e. frame 3 has not been acknowledged), then the
sender goes back and sends frames 3, 4, 5, 6 again. Thus it is called Go-
Back-N-ARQ
 The receiver does not have to acknowledge each frame
received, it can send one cumulative ACK for several frames.
operation
• The sender keeps track of the outstanding frames and
updates the variables and windows as the ACKs arrive.
Go-Back-N ARQ, lost frame
• Frame 2 is lost
• When the
receiver receives
frame 3, it
discards frame 3
as it is expecting
frame 2
(according to
window).
• After the timer
for frame 2
expires at the
sender site, the
sender sends
frame 2 and 3.
(go back to 2)
Go-Back-N ARQ, damaged/lost/delayed ACK

• If an ACK is damaged/lost, we can have two situations:


• If the next ACK arrives before the expiration of any
timer, there is no need for retransmission of frames
because ACKs are cumulative in this protocol.
• If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it
arrives before the timer expires.
• If ACK4 arrives after time-out, the last frame and all the
frames after that are resent.
• Receiver never resends an ACK.
• A delayed ACK also triggers the resending of frames
Go-Back-N ARQ, sender window size
• Size of the sender window must be less than 2 m. Size of the
receiver is always 1. If m = 2, window size = 2 m – 1 = 3.
• Fig compares a window size of 3 and 4.

Accepts
as the 1st
frame in
the next
cycle-an
error
Selective Repeat ARQ, sender and receiver
windows
• Go-Back-N ARQ simplifies the process at the receiver site. Receiver only
keeps track of only one variable, and there is no need to buffer out-of-order
frames, they are simply discarded.
• However, Go-Back-N ARQ protocol is inefficient for noisy link. Its bandwidth
inefficient and slows down the transmission.
• In Selective Repeat ARQ, only the damaged frame is resent. More
bandwidth efficient but more complex processing at receiver.
• It defines a negative ACK (NAK) to report the sequence number of a
damaged frame before the timer expires.
Selective Repeat ARQ, lost frame• Frames 0 and 1
are accepted
when received
because they
are in the range
specified by the
receiver
window. Same
for frame 3.
• Receiver sends
a NAK2 to show
that frame 2
has not been
received and
then sender
resends only
frame 2 and it
is accepted as it
is in the range
of the window.
Selective Repeat ARQ, sender window size
• Size of the sender and receiver windows must be at most one-half of 2 m.
• If m = 2, window size should be 2 m /2 = 2. Fig compares a window size of 2
with a window size of 3. Window size is 3 and all ACKs are lost, sender sends
duplicate of frame 0, window of the receiver expect to receive frame 0 (part
of the window), so accepts frame 0, as the 1st frame of the next cycle – an
error.

You might also like