2. Computer Network
A computer network is a group of interconnected computers. It allows
computers to communicate with each other and to share resources and
informationinformation.
Applications
1 Resource Sharing(Hardware & Software)1. Resource Sharing(Hardware & Software)
2. Information Sharing
Easy accessibility from anywhere (files, databases)
Search Capability (WWW)
3. Communication
Email Email
Message broadcast
4. Remote computingp g
5. Distributed processing (GRID Computing)
3. Classification of networksC ass cat o o etwo s
1. By Size or Scale
2. By Structure / Functional Relationship
3. By Topology / Physical Connectivity
4. 1. By Size or Scale
Personal Area Networks(PAN)
Local Area Networks(LAN)
Wid A N k (WAN) Wide Area Networks(WAN)
Metropolitan Area Networks(MAN)
Internetworks Internetworks
5. Personal Area Network (PAN) Personal Area Network (PAN)
Very small scale network
Range is less than 2 metersg
Cell phones, PDAs, MP3 players
Local Area Network (LAN)
Contains printers, servers and computers
Systems are close to each other
C i d i ffi b ildi Contained in one office or building
Organizations often have several LANS
Wide Area Networks (WAN) Wide Area Networks (WAN)
Two or more LANs connected over a large geographic area
Typically use public or leased lines(Phone lines,)Satellite Typically use public or leased lines(Phone lines,)Satellite
The Internet is a WAN
6. Metropolitan Area Network (MAN)
Large network that connects different organizations Large network that connects different organizations
Shares regional resources
Ex:Cable television network
Internet
A collection of interconnected networks.
global computer network
7. 2. By Structure / Functional Relationship
Client / Server
Peer to Peer (P2PN) Peer to Peer (P2PN)
Client/Server network
Nodes and servers share data
Nodes are called clients
Servers are used to control access
Server is the most important
computer
8. Peer to peer networks (P2PN)
All nodes are equal
Nodes access resources on other nodes
E h d t l it Each node controls its own resources
Most modern OS allow P2PN
Distributed computing is a form Distributed computing is a form
9. 3. By Topology / Physical Connectivity
N k T l f h L i l l f i d i• Network Topology refers to the Logical layout of wires and equipment
• Choice affects
Network performance
• Different network topologies are
p
Network size
Network collision detection
• Different network topologies are
BUS
STAR
RING
MESH
TREE
10. BUS
Also called linear bus
One wire connects all nodes
Advantages
Easy to setup
Small amount of wire
i d Disadvantages
Slow
Easy to crash Easy to crash
11. STAR
Most common topology
All nodes connect to a hub
Packets sent to hub Packets sent to hub
Hub sends packet to destination
Advantages
Easy to setup
One cable can not crash network
Disadvantages Disadvantages
One hub crashing downs entire network
Uses lots of cable
12. RING
Nodes connected in a circle
T k d i d Tokens used to transmit data
Nodes must wait for token to send
Advantages Advantages
No data collisions
Disadvantagesg
Slow
Lots of cable
• Single ring – All the devices on the
network share a single cable .
• Dual ring The dual ring topology allows• Dual ring – The dual ring topology allows
data to be sent in both directions.
13. MESH
• All computers connected togetherp g
• Internet is a mesh network
• Advantage
- Data will always be delivered
• Disadvantages
- Lots of cable
- Hard to setup
14. TREE
Hierarchal Model Hierarchal Model
extended star topology
Advantages Advantages
Scalable
Easy Implementation
Easy Troubleshooting
16. Protocols and protocol architecture.Protocols and protocol architecture.
Protocol
• A standard that allows entities (i.e. application programs) from( pp p g )
different systems to communicate. It contains conventions and
associated rules
I l d t ti d ti i• Includes syntax, semantics, and timing
Syntax(Data formats, Signal levels etc)
Semantics(Control information Error handling etc)Semantics(Control information, Error handling etc)
Timing(Speed matching (e.g., indicates flow control),Sequencing
(e.g., avoid packet duplication))( g , p p ))
17. Principles of Protocol Architecture
Layered structure
Protocol stack
Each layer provides services to upper layer; expect services from Each layer provides services to upper layer; expect services from
lower one
Layer interfaces should be well-defined
Peer entities communicate using their own protocol
peer-to-peer protocols
independent of protocols at other layers independent of protocols at other layers
if one protocol changes, other protocols should not get affected
18. Simplified File Transfer Architecture
• file transfer could use three modules
1 Fil f li i1. File transfer application
2. Communication service module
3. Network access module
19. File Transfer Application Layer
•Application specific commands passwords and the actual file(s) –•Application specific commands, passwords and the actual file(s) –
high level data
C i i S i M d lCommunications Service Module
• reliable transfer of data – error detection, ordered delivery of data
packets, etc.
Network Module
• actual transfer of data and dealing with the network – if the network
changes, only this module is affected, not the whole systemc a ges, o y s odu e s a ec ed, o e w o e sys e
20. A General Three Layer Model
Network Access Layery
Transport Layer
Application Layer
21. Network Access Layer
• Exchange of data between the computer and the network
• Sending computer provides address of destination
• need specific drivers and interface equipment depending on type
f k d( k CKT i h d N k )of network used(packet or CKT switched Network etc.)
Transport Layer
• Ensures reliable data exchange between 2 hostsEnsures reliable data exchange between 2 hosts
• to make sure that all the data packets arrived in the same order in
which they are sent out
• Packets nor received or received in error are retransmitted
Application Layer
• Support for different user applications• Support for different user applications
• e.g. e-mail, file transfer
23. Protocol Data Units
User data is passed from layer to layer User data is passed from layer to layer
Control information is added/removed to/from user data at each
layery
Header (and sometimes trailer)
each layer has a different header/trailer
Data + header + trailer = PDU (Protocol Data Unit)
This is basically what we call packet
h l h diff t PDU each layer has a different PDU
24. Transport PDU
Transport layer may fragment user data
Each fragment has a transport header ,that contains
Destination port
Sequence number
since the transport layer may split application data into smaller
packetspackets
Error detection code
Network PDU
Adds network header
•network address for destination computer
•optional facilities from network (e g priority level)optional facilities from network (e.g. priority level)
25.
26. Standard Protocol Architectures
Two approaches (standard)Two approaches (standard)
•OSI Reference model(never used widely, but well known)
•TCP/IP protocol suite(Most widely used)
Another approach (proprietary)
IBM’s Systems Network Architecture (SNA)
27. OSI (Open Systems Interconnection)
Reference ModelReference Model
Reference model
provides a general framework for standardization
d fi f l i h ifi i defines a set of layers with specific services
one or more protocols can be developed for each layer
Developed by the International Organization for Standardization (ISO) Developed by the International Organization for Standardization (ISO)
7 Layers
1. Physical
2. Data link
3. Network
4 Transport4. Transport
5. Session
6. Presentation
7. Application
28.
29. Advantage
Each layer performs a set of communication functionsy p
Each layer relies on the next lower layer to perform more primitive
functions
Each layer provides services to the next higher layer Each layer provides services to the next higher layer
Changes in one layer should not require changes in other layers
Layers are entirely independent and transparent to other layers
31. Physical Layer
Purpose
Deals with the representation ,transmission and synchronization
of bits
T l ti f bit i t i l Translation of bits into signals
Define data rate and transmission mode
Define the interface to the card Define the interface to the card
Electrical
Mechanical
Functional
Example: Pin count on the connector
32. Data Link Layer
Purpose
Manages the flow of data over the physical media
Framing
Responsible for error-free transmission over the physical media
Subdivided into two
1 MAC (M di A C t l)1. MAC (Media Access Control)
Gives data to the NIC
Controls access to the media through :CSMA/CD and Token passing Controls access to the media through :CSMA/CD and Token passing
2. LLC (Logical Link Layer)
Manages the data link interface or Service Access Points (SAPs))
Can detect some transmission errors using a CRC
33. Network layer
Purposep
Logical Addressing and routing the packets
Routing of data, Based on priority or Best path at the time of
transmissiontransmission.
Congestion control
Address translation from logical to physicalg p y
Ex: Google ----------> 102.13.345.25
Example application at the router
If the packet size is large, splits into small packets then route
the packet
34. Transport Layer
Purpose
End to end exchange of data
In sequence, no losses, no duplicates
If d d l d li i ll i If needed, upper layer data are split into smaller units
35. Session Layer
Purposep
Oversee a communication session
Establish
Maintain
Terminate
S h i ti b t d d i Synchronization between sender and receiver
Assignment of time for transmission
Start time Start time
End time etc.
36. Presentation Layer
Purposep
Formats data for exchange between points of communication
Protocol conversion
Data translation
Encryption
Application Layer
Purpose
Support for various applicationsSupport for various applications
Provides an interface for the end user
Provides variety of protocols
E il i R t l i fil d t fEx: mail services ,Remote login, file access and transfer
37.
38. TCP/IP ProtocolTCP/IP Protocol
Most widely used interoperable network protocol architecture
Funded by the US Defense Advanced Research Project Agencyy j g y
(DARPA) for its packet switched network (ARPANET)
Used by the Internet and WWW
Layers of TCP/IP.
1. Application Layer
2 Host to host2. Host to host
3. Internet Layer
4. Network Access Layere wo ccess ye
39. Network Access Layer
• Exchange of data between end system and the networkg y
• Formatting the data into a unit called frame and convert that frame into
electric or analog pulses.
• Responsible to deliver frames reliably from hop to hop (hop could be
device such as bridges or switches)
• Guarantee Error Free Delivery of Data from one hop to the other• Guarantee Error Free Delivery of Data from one hop to the other
• Acknowledging receipt of data frames and resending frames if ack is
not received
• Core protocols: Ethernet, Token-Ring
40. Internet Layer
• PackagingPackaging
• Addressing
• Routingg
• deals with end-to-end transmission
• Implemented in end systems and routers as the Internet Protocol (IP)
G E F D li f P k f N/W h h• Guarantee Error Free Delivery of Packets from one N/W to the other
N/W
• Core protocols: IP(Internet Protocol),ICMP(Internet Control Messagep ( ) ( g
Protocol),ARP(Address Resolution Protocol)
41. IP (Internet Protocol)
The core of the TCP/IP protocol suitep
Two versions co-exist
v4 – the widely used IP protocol(32 bit)
6 h b t d di d i 1996 b t till t id l v6 – has been standardized in 1996, but still not widely
deployed(128bit), for modern high speed networks
42. Transport Layer
• Guarantee Error Free Delivery of Message from source-host toGuarantee Error Free Delivery of Message from source host to
the destination-host (End-to-End reliability)
• Offers connection oriented and connection less services
• Reliability includes: Error detection and correction, flow control,
packet duplication etc…
• Runs only on host not on the network• Runs only on host not on the network
Core Protocols
1. TCP(Transmission Control Protocol)C ( s ss o Co o o oco )
2. UDP(User Datagram Protocol)
43. TCP
One-to-one and connection-oriented reliable protocol
U d i h i i f l f d Used in the accurate transmission of large amount of data
Slower compared to UDP because of additional error checking being
performedp
UDP
• One-to-one or one-to- many, connectionless and unreliable protocoly, p
• Used for the transmission of small amount of data
• Used in video and audio casting(Multicasting and Broadcasting )
• Also used for multimedia transmission
• Faster as compared to TCP
44. Application Layer
•Provide interface between end-user & applications
•Support several users applications
For example: FTP, HTTP, SMTP
Layer Protocols
Application
Transport
HTTP TELNET FTP SMTP SNMP
TCP UDPTransport
Internet
TCP UDP
IP ICMP
Network Access
(Host-to-network)
ETHERNET PACKET RADIO
TCP/IP Layers with Protocols
48. OSI
1)It has 7 layers
TCP/IP
1)Has 4 layers) y
2)Separate presentation layer
) y
2)No presentation layer,
characteristics are provided by
li ti l
3) Separate session layer
application layer
3)No session layer, characteristics
are provided by transport layer
4)Network layer provides both
connectionless and connection
p y p y
4)Network layer provides only
connectionless and connection
oriented services
connection less services
49. 5)It defines the services, interfaces
and protocols very clearly and
5)It does not clearly distinguishes
between service, interface and
makes a clear distinction
between them
6)The protocol are better hidden
protocols.
6)It i t t l th6)The protocol are better hidden
and can be easily replaced as the
technology changes
6)It is not easy to replace the
protocols
7)OSI truly is a general model
7)TCP/IP can not be used for any
other application
50. Critiques
OSI
Bad timing, by the time the OSI protocols appeared, the competition
TCP/IP l l d i id d
q
TCP/IP protocols were already in widespread use.
Bad technology, both the model and the protocols are imperfect and
very complex.very complex.
Bad implementation, (poor quality)
Bad politics, it was thought to be the creature of the government.
51. TCP/IP
The model does not clearly distinguish the concepts of services The model does not clearly distinguish the concepts of services,
interface, and protocol.
It is not at all general and is poorly suited to describing any protocolg p y g y p
stack other than TCP/IP.
The host-to-network layer is not really a layer.
The model does not distinguished the physical and data link layers
52. Novel Netware.Novel Netware.
Novell introduced its multiprocessing network operating system
named NetWare
N t i Netware versions
1. Version 3 – popular but older
User logs onto a particular server and maintains directory systemg p y y
2. Version 4
allows single network login and Directory system replaced by
powerful NDS databasepowerful NDS database
3. Version 5
Allows to use IP protocol instead of Novell’s proprietary IPX/SPX
protocols
4. Version 6
Remote manager Native File Access iFolder and iPrint Remote manager, Native File Access , iFolder and iPrint
5. Version 6.5
53. NetWare loadable modules (NLM )
When considering NetWare, note the number of NetWare loadable
modules (NLMs) used by each service
•NLMs are routines that enable the server to run a range of programs
and offer a variety of servicesand offer a variety of services
•Each NLM consumes some of the server’s memory and processor
resources (at least temporarily)
54. NetWare Directory Services (NDS)
Provides a system for managing multiple servers and their resourcesy g g p
•NDS tree
The logical representation of resources in a NetWare enterprise
57. IPX
Internet Protocol Exchange (IPX) is a connectionless datagramg ( ) g
protocol that delivers packets across the Internet and provides NetWare
workstations and file servers with addressing and internetworking
routing servicesrouting services.
RIPX
The Routing Information Protocol (RIP), is used to collect, maintaing ( ), ,
and exchange correct routing information among gateways within the
Internet.
BCAST BCAST
The Broadcast (BCAST) protocol deals with announcements from the
network informing the user that he has received a message.network informing the user that he has received a message.
58. DIAG
The Diagnostic Responder (DIAG) protocol is useful in analyzingg p ( ) p y g
NetWare LANs. DIAG can be used for connectivity testing,
configuration and information gathering.
SER SER
the operating system broadcasts copy-protection packets, called
Serialization packets, to determine whether there are multiple copiesp , p p
of the same operating system on the network.
WDOG
The Watchdog (WDOG) protocol provides constant validation of
active workstation connections and notifies the NetWare operating
system when a connection may be terminated as a result of lengthysystem when a connection may be terminated as a result of lengthy
periods without communication.
59. SPX
The Sequential Packet Exchange (SPX), is a transport layer protocol
providing a packet delivery service for third party applications.
SAP
SAP i id i f ti ll th k th h tSAP services provide information on all the known servers throughout
the entire internetwork.
BMP (Burst)( )
The Burst Mode Protocol (BMP) was designed to allow multiple
responses to a single request for file reads and writes.
60. NCP
The Netware Core Protocol (NCP) manages access to the primary( ) g p y
NetWare server resources.
NDS
NetWare Directory Services (NDS) providing access to all network
services.
NLSP NLSP
NetWare Link Services Protocol (NLSP) provides link state routing for
Internetwork Packet Exchange networks.
61. Data Link LayerData Link Layer
Two Types of networks in DLL
Broadcast Networks: All stations share a single communication Broadcast Networks: All stations share a single communication
channel
Point-to-Point Networks: Pairs of hosts (or routers) are directly
connected
The main design issues of the data link layer are: The main design issues of the data link layer are:
1. Services provided to the Network Layer
2. Framing2. Framing
3. Flow Control
4. Error Control
62. 1. Provides a well-defined service interface to the network layer.
Principal Service Function of the data link layer is to transfer the data
from the network layer on the source machine to the network layer on
the destination machine.
(a) Virtual communication. (b) Actual communication.
63. Possible Services Offered to network layer
a. Unacknowledged connectionless service.g
b. Acknowledged connectionless service.
c. Acknowledged connection-oriented service.
a. Unacknowledged Connectionless Service
• It consists of having the source machine send independent frames to the
destination machine without having the destination machine
acknowledge them.
•Example: Ethernet Voice over IP etcExample: Ethernet, Voice over IP, etc.
64. b. Acknowledged connectionless service
• Each frame send by the Data Link layer is acknowledged and they y g
sender knows if a specific frame has been received or lost.
• Typically the protocol uses a specific time period that if has passed
ith t tti k l d t it ill d th fwithout getting acknowledgment it will re-send the frame.
c. Acknowledged Connection Oriented Service
• Source and Destination establish a connection first• Source and Destination establish a connection first.
• Each frame sent is numbered
It guarantees that each frame is received only once and that allg y
frames are received in the correct order.
• Examples:
Satellite channel communication,
65. 2. Framing
Determines how the bits of the physical layer are grouped into frames
(f i )(framing).
frame header, payload and frame trailer.
Three popular solutions:
1. Character count
Fl b i h b ffi2. Flag bytes with byte stuffing
3. Starting and ending flags, with bit stuffing
66. It uses a field in the header to specify the number of bytes in the frame.
Once the header information is being received it will be used to
1. Character Count
Once the header information is being received it will be used to
determine end of the frame.
See figure, Destination may be able to detect that the frame is in error
but it does not have a means how to correct it.
67. 2. Byte stuffing
The sender inserts a special byte (ESC-Escape Character) just before
each flag byte in the data.each flag byte in the data.
beginning and ending byte in the frame are called flag byte.
The receiver’s link layer removes this special byte before the data
are given to the network layerare given to the network layer.
(a) frame delimited by flag bytes (b)Four examples of byte sequences before and after byte
stuffing.
68. 3. Bit stuffing
each frame starts with a flag byte “01111110”.
Whenever the sender encounters five consecutive 1s in the data, it
automatically stuffs a 0 bit into the outgoing bit stream.
When the receiver sees five consecutive incoming 1 bits followed by a When the receiver sees five consecutive incoming 1 bits, followed by a
0 bit, it automatically deletes the 0 bit.
USB uses bit stuffing.g
69. Bit t ffiBit stuffing:
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in the receiver’s memory after destuffing.
70. 3. Flow Control
Flow control will control the rate of frame transmission and ensure the
sending entity does not overwhelm the receiving entity
It uses some feedback mechanism(acknowledgement)
If th f i t d / d b th i th l ill th If the frame is accepted /processed by the receiver then only will the
sender send the next frame.
Flow control ensures that the speed of sending the frame, by thep g , y
sender, and the speed of processing the received frame by the receiver
are compatible.
T h d h b d l d l fl f d Two methods have been developed to control flow of data across
communications links:
1. Stop and Wait1. Stop and Wait
2. Sliding Window
72. 1 Stop-and-Wait Flow Control1. Stop and Wait Flow Control
a single frame is send at a time.
Source transmits a frame Source transmits a frame.
Destination receives the frame, and replies with a small frame called
acknowledgement (ACK).
Source waits for the ACK before sending the next frame.
It will then send the next frame only after the ACK has been received.
Sender keeps a copy of the frame until it receives an
acknowledgement.
Destination can stop the flow by not sending ACK (e g if the Destination can stop the flow by not sending ACK (e.g., if the
destination is busy …).
73. For identification, both data
frames and acknowledgementsg
(ACK) frames are numbered
alternatively 0 and 1.
Sender has a control variable (S)
that holds the number of the
tl t f (0 1)recently sent frame. (0 or 1)
Receiver has a control variable R
that holds the number of the next
frame expected (0 or 1).
Stop and wait strategy
74. The advantage of stop and- wait is simplicity:
Each frame is checked and acknowledged before theEach frame is checked and acknowledged before the
next frame is sent.
The disadvantage is inefficiency:
• In stop-and-wait, at any point in time, there is only
one frame that is sent and waiting to be
acknowledgedacknowledged.
• stop-and-wait is slow. Each frame must travel all the
way to the receiver and an acknowledgment must
travel all the way back before the next frame can be
sent.
75. 2 Sliding window2.Sliding window
Idea: allow multiple frames to transmit
Receiver has a buffer of W frames
Transmitter can send up to W frames without receiving ACK
So the link is utilized in a more efficient manner
Each data frame carries a sequence number for its identification
ACK includes the sequence number of the next expected frame by the
receiverreceiver.
All the previous data frames are assumed acknowledged on receipt
of an acknowledgement
The sender sends the next n frames starting with the last received
sequence number that has been transmitted by the receiver (ACK).
76. In this mechanism we maintain two types of windows:
sending window and receiving window
sending window
Sending window maintains sequence numbers of frames sent out but
t k l d d d f hi h t t b t itt dnot acknowledged and frames which are next to be transmitted.
At the beginning of a transmission, the sender’s window contains n
frames.
As frames are sent out, the left boundary of the window moves inward,
shrinking the size of the window.
Once an ACK arrives, the window expands to allow in a number of
new frames equal to the number of frames acknowledged by that
ACK.ACK.
77.
78. receiving window
The receiver window maintains the set of frames permitted to accept.
At the beginning of transmission, the receiver window contains n
spaces for frames.
As new frames come in, the size of the receiver window shrink As new frames come in, the size of the receiver window shrink
As each ACK is sent out, the receiving window expands to include as
many new placeholders as newly acknowledged frames
79.
80. 4. Error control
An error occurs when a bit is altered between transmission and
reception
i. Single bit errors
O bit i lt d One bit is altered
Adjacent bits are not affected
ii Burst errorsii. Burst errors
A cluster of bits altered
a number of bits in error
More common and more difficult to deal
81. Error control in the data link layer is based on Automatic Repeat
Request(ARQ), which is the retransmission of data.
82. i. Stop-and-Wait ARQ
keeping a copy of the sent frame and retransmitting of the frame
when the timer expires.when the timer expires.
use sequence numbers to number the frames
The source station is equipped with a timer.
S t it i l f d it f ACK If th f i Source transmits a single frame, and waits for an ACK,If the frame is
lost…the source retransmits the frame.
If receiver receives a damaged frame, discard it and the source
retransmits the frame.
If everything goes right, but the ACK is damaged or lost, the source
will not recognize it, the source will retransmit the frame, Receiverwill not recognize it, the source will retransmit the frame, Receiver
gets two copies of the same frame! Solution: use sequence numbers,
83. There are four different scenarios that can happen:
Normal Operation Normal Operation
When ACK is lost
When frame is lost
Wh ACK ti t When ACK time out occurs
• Simple but inefficient for long distance and high speed• Simple, but inefficient for long distance and high speed
applications.
84. Stop-and-Wait ARQ-Normal Operation
Sender is sending frame0 and Sender is sending frame0 and
waits for ACK1
Once it receives ACK1 in time
(allotted time) it will send
frame1.
This process will be continuous This process will be continuous
till complete data transmission
takes place.
85. Stop-and-Wait -lost ACK frame
If the sender receives a damagedIf the sender receives a damaged
ACK, it discards it.
Here, as the time expires for ACK0 it
will retransmit frame1
Receiver has already received frame1
and expecting to receive frame0and expecting to receive frame0
(R=0). Therefore it discards the
second copy of frame1.
Thus the numbering mechanism
solves the problem of duplicate copy
of frames.of frames.
86. Stop-and-Wait ARQ- lost frame
If the receiver receives If the receiver receives
corrupted/damaged frame it will
simply discard it and assumes that the
f l t thframe was lost on the way.
the sender will not get ACK
The sender will be in waiting stage The sender will be in waiting stage
for ACK till its time out occurs in the
system.
As soon as time out occurs in the
system, the sender will retransmit the
same frame and the receiver will sendsame frame and the receiver will send
the acknowledgment
87. Stop-and-Wait, delayed ACK frame
The ACK can be delayed at the
receiver or due to some problem
It i i d ft th ti f It is received after the timer for
frame0 has expired.
Sender retransmitted a copy of
frame0.However, R=1 means
receiver expects to see frame1.
Receiver discards the duplicate
frame0.
Sender receives 2 ACKs, it
discards the second ACK.discards the second ACK.
88. ii. Go-Back-N ARQ
Based on sliding-window flow control.
allowing transmission of more than one frame without waiting for
acknowledgement
If th d ti ti ill d ACK l ith t f If no error, the destination will send ACK as usual with next frame
expected (positive ACK, RR: receive ready)
If error, the destination will reply with rejection (negative ACK, If error, the destination will reply with rejection (negative ACK,
REJ: reject)
Receiver discards that frame and all future frames, until the
f i i d lerroneous frame is received correctly.
Source must go back and retransmit that frame and all succeeding
frames that were transmitted.frames that were transmitted.
This makes the receiver simple, but decreases the efficiency
89. Damaged Frame
Suppose A is sending frames to B. After each transmission, A sets a
timer for the frame.
In Go-Back-N ARQ, if the receiver detects error in frame i
• Receiver discards the frame, and sends REJ-IReceiver discards the frame, and sends REJ I
• Source gets REJ-I
• Source retransmits frame i and all subsequent frames
Lost Frame 1Lost Frame 1
Assume receiver has received frame i-1. If frame i is lost. Source
subsequently sends i+1
Receiver gets frame i+1 out of order, this means the lost of a frame!
Receiver sends REJ-I, Source gets REJ-i, and so goes back to frame
i and retransmits frame i, i+1, …d e s s e , , …
90. Lost Frame 2
Assume receiver has received frame i-1
Frame i is lost and no additional frame is sent
Receiver gets nothing and returns neither acknowledgement nor
rejectionrejection
Source times out and sends a request to receiver asking for
instructions
Receiver responses with RR frame including the number of the Receiver responses with RR frame, including the number of the
next frame it expects, i.e., frame I
Source then retransmits frame i
91. Damaged RR
Receiver gets frame i and sends RR(i+1) which is lost or damaged
Acknowledgements are cumulative, so the next acknowledgement,
i.e., RR(i+n) may arrive before the source times out on frame I
If source times out, it sends a request to receiver asking forIf source times out, it sends a request to receiver asking for
instructions, just like the previous example
92.
93. iii. Selective Repeat ARQ
Pros:
Only rejected frames are retransmitted
Subsequent frames are accepted by the receiver and buffered
Minimizes the amount of retransmissions
Cons:
R i t i t i l h b ff d t t i l i Receiver must maintain large enough buffer, and must contain logic
for reinserting the retransmitted frame in the proper sequence
Also more complex logic in the sourcep g
94. Retransmission mechanism
Timer: When the timer expires, only the corresponding frame is
t itt dretransmitted.
NAK: Whenever an out-of-sequence frame is observed at the
receiver, a NAK frame is sent with sequence number Rnext. When, q
the transmission receives such a NAK frame, it retransmits the
specific frame, Rnext.
95.
96. Performance
More efficient than the other two protocols because it reduces
number of retransmissions for noisy links
The receiver and transmitter processing logic is more complex
Receiver must be able to reinsert the retransmitted (lost delayed Receiver must be able to reinsert the retransmitted (lost, delayed,
damaged) frame in the proper sequence after it arrives
The sender should be able to send out of order frame when
requested by the sender using NAKrequested by the sender using NAK
Needs more memory than Go-Back-N ARQ at the receiver side.
97. Error Detection
Error detecting codes.
Include only enough redundancy (which means adding extra
Error Detection
bits for detecting errors at the destination)to allow the receiver to
deduce that an error has occurred.
99. i. Parity Check
A parity bit is added to every data unit so that the total number of
1 (i l di th it bit) b f it h k1s(including the parity bit) becomes even for even-parity check or
odd for odd-parity check
Simple parity check
100. • Suppose the sender wants to send the word world. In ASCII the five
characters are coded as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sentThe following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
received by the receiver without being corrupted in transmissionreceived by the receiver without being corrupted in transmission.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up with even
numbers (6, 6, 4, 4, 4). The data are accepted.
101. ii. Cyclic Redundancy Check
Sender
• In CRC sender divides frame (data) by using a predeterminedIn CRC sender divides frame (data) by using a predetermined
Generator Polynomial.
• A generating polynomial is an industry approved bit string that is used
t t li h k i dto create cyclic checksum remainder
• The reminder obtained after division is appended to the end of the
original message and is transmitted over the medium.
Receiver
• At the destination, the incoming data unit is divided by the same
generating polynomialgenerating polynomial.
• If there is no remainder, the data unit is assumed to be correct and is
therefore accepted
A i d i di t th t th d t it h b d d i t it• A remainder indicates that the data unit has been damaged in transmit
and therefore must be rejected.
102.
103. • Suppose a m bit message is to be transmitted and we are using a
generating polynomial of length n+1
• Multiply the original message by 2n and divide it by generating
polynomial
Th i d f thi di i i t th bit (CRC)• The remainder of this division process generates the n-bit (CRC)
remainder which will be appended to the m-bit message
producing (m+n) bit frame for transmission
• On receiving the packet, the receiver divides the (m+n) bit frame
by the same generating polynomial and if it produces no
remainder no error has occuredremainder ,no error has occured
104. Ex:Given
Message D = 1010001101 (10 bits)
P tt P 110101(6 bit )Pattern P = 110101(6 bits)
Remainder R =to be calculated(5 bits)
Thus m= 10, n+1 = 6,n = 5.
The message is multiplied by 25 yielding 101000110100000.
This product is divided by P
105. The division process is defined as follows:
1. Call the uppermost n+1 bits of the message the remainder
2. Beginning with the most significant bit in the original message and
for each bit position that follows, look at the n+1 bit remainder:
• If the most significant bit of the remainder is a one, the divisor isIf the most significant bit of the remainder is a one, the divisor is
said to divide into it. In this case of binary division, we simply:
• Set the appropriate bit in the quotient to a one, and
• XOR the remainder with the divisor and store the result back• XOR the remainder with the divisor and store the result back
into the remainder
• Otherwise (if the first bit is not a one):
• Set the appropriate bit in the quotient to a zero, and
• XOR the remainder with zero (no effect)
• Left-shift the remainder, shifting in the next bit of the message.e s e e de , s g e e b o e ess ge.
106.
107.
108. • The remainder is added to D to give T=1 0 1 0 0 0 1 1 0 1 0 1 1 1 0
which is transmitted.
• If there are no errors, the receiver receives T intact. The received
frame is divided by P
• If there is no Remainder it is assumed that there have been no errorsIf there is no Remainder it is assumed that there have been no errors
109.
110. iii. Checksum
Sender Side
The unit is divided into k sections, each of n bits.
All sections are added together to get the sum.
The sum is complemented and becomes the checksum.
The checksum is sent with the data.
Receiver Side
The unit is divided into k sections, each of n bits.
All sections are added together to get the sum All sections are added together to get the sum.
The sum is complemented.
If the result is one, the data are accepted: otherwise, they are rejected. If the result is one, the data are accepted: otherwise, they are rejected.
111.
112. HDLC(High-Level Data Link Control)
It is a bit-oriented protocol developed by ISO where information is
send as a sequence of bits.
Frames are used as a transport mechanism to transport data from one
point to another.
f t features :
i. Reliable protocol (selective repeat or go-back-N)
ii Full-duplex communication (receive and transmit at the same time)ii. Full-duplex communication (receive and transmit at the same time)
iii. Bit-oriented protocol
iv. Flow control (adjust window size based on receiver capability).( j p y)
v. Uses physical layer clocking and synchronization to send and
receive frames
113. To satisfy a variety of applications, HDLC defines 3 types of stations,
two link configuration and three data transfer modes
The three station types are:
Primary station
Has the responsibility of controlling the operation of data flow Has the responsibility of controlling the operation of data flow .
Handles error recovery
Frames issued by the primary station are called commands.
S d t ti Secondary station,
Operates under the control of the primary station.
Frames issued by a secondary station are called responses.
The primary station maintains a separate logical link with each
secondary station.
Combined station,
Acts as both as primary and secondary station.
114. The two link configurations are:
i Unbalanced Configuration: Consists of one primary and two ori. Unbalanced Configuration: Consists of one primary and two or
more secondary.
i. Balanced Configuration: Consists of two combined stations andg
supports both full-duplex and half-duplex
transmission
116. The three modes of data transfer operations are
Normal Response Mode (NRM)
Secondary station can send only when the primary station instruct Secondary station can send only when the primary station instruct
it to do so
Two common configurations
Point to Point link (one primary and one secondary station)a. Point-to-Point link (one primary and one secondary station)
b. Multipoint link (primary station maintain different sessions with
different secondary stations)
As nchrono s Response Mode (ARM) Asynchronous Response Mode (ARM)
More independent secondary station
Can send data or control information without explicit permission to
ddo so
Asynchronous Balanced Mode (ABM)
used in point-to-point links, for communication between combined
istations
Either stations can send data, control information and commands
117. Frames
HDLC
FRAMES
U-frame I-frame S-frame
Unnumbered frames, used in link setup and disconnection,
Information frames, which carry actual information.
S i f hi h d f d fl l Supervisory frames, which are used for error and flow control
purposes and hence contain send and receive sequence numbers
118. Frame structure
Flag: bit pattern that shows both the beginning and the end of a frame.
Address: contains the address of the secondary station and identifies
whether the frame is a command or response
Control: Identifies the type of HDLC frame i e (I S or U frames) Control: Identifies the type of HDLC frame i.e..(I,S or U-frames)
Information: present only in I-frames and some U-frames.
Frame Check Sequence (FCS): This field contains a 16-bit, or 32-bit Frame Check Sequence (FCS): This field contains a 16 bit, or 32 bit
CRC bits which is used for error detection
119. Operation
Three phasesp
initialization
by either side, set mode & information
d t t f data transfer
with flow and error control
using both I & S-framesg
disconnect
when ready or fault noted
120. LAPB -Linked Access Protocol (Balanced)
X.25 is a network interface commonly used for interconnecting
LANs
The X.25 defines the lowest three layers of the OSI Reference Model
: Physical layer, Data link Layer and Network Layer
LAPB i bit i t d h t l d t LAPB is a bit-oriented synchronous protocol used to manage
communication between data terminal equipment (DTE) and the data
circuit-terminating equipment (DCE) devices
Data terminal equipment devices are end systems that communicate
across the X.25 network. They are usually terminals, personal
computers or network hosts and are located on the premises ofcomputers, or network hosts, and are located on the premises of
individual subscribers.
121. DCE devices are communications devices, such as modems and packet
switches
The address field can contain only one of two fixed (DTE or DCE)
addresses
122. LAPD- Linked Access Protocol (D Channel)
protocol for the D channel,D channel is the data or signaling channel
which is used for carrying control and signalling information
LAPD Linked Access Protocol (D Channel)
handle the handshaking(commands and responses), signalling, and
control for all of the voice and data calls that are setup through the ISDN
D channelD channel
works in the Asynchronous Balanced Mode (ABM),This mode is totally
balanced (i.e., no master/slave relationship). Each station may initialize,
i f d d f t tisupervise, recover from errors, and send frames at any time
The objective is to provide a secure, error-free connection between two
end-points so as to reliably transport Layer 3 messages.p y p y g
shares the same frame format, frame types, and field functions as HDLC
and provides framing, sequence control, error detection, and recovery
123. SAPI: Identifies the port at which LAPD services are provided to
Layer 3.
C/R: Indicates whether the frame contains a command or a response.
TEI:Identifies either a single terminal or multiple terminals
compatible with the ISDN networkcompatible with the ISDN network.