NETWORKS
COMPUTER NETWORKS
5
Chapter 1
Need for protocol
• In networks, communication occurs
between the entities in different systems.
• Two entities cannot just send bit streams
to each other and expect to be understood.
• For communication, the entities must
agree on a protocol.
• A protocol is a set of rules and regulations
that govern data communication.
6
Chapter 1
Group of OSI layer by function
• The seven layers of the OSI model belonging to three
subgroups.
• Physical, data link and network layers are the network
support layers; they deal with the physical aspects of
moving data from one device to another.
• Session, presentation and application layers are the user
support layers; they allow interoperability among unrelated
software systems. (Interoperable: when two or more
protocols that implement the specification accurately)
• The transport layer ensures end-to-end reliable data
transmission.
7
Chapter 1
Description of Layers
• Physical layer - Encoding, Data rate, Physical
topology (ring, star, bus), Transmission mode.
• Data link layer - Framing, Physical addressing, Error
control, Flow control, Access control
• Network layer – Source to destination delivery of
packets, Logical addressing, routing
• Transport layer – End to end delivery of entire
message- Service-point addressing, Segmentation
and reassembly, Connection control.
• Session layer – It establishes and maintains and
synchronizes interaction among communication
systems. Dialog control, synchronization, binding
8
Chapter 1
Contd.
• Presentation layer: Translation,
Encryption, Compression
• Application layer: The application layer
enables the user, whether human or
software, to access the network. It
provides user interface and support for
services such as electronic mail, remote
file access, shared database management
and several types of distributed services.
9
Chapter 1
Syllabus
• UNIT I FUNDAMENTALS & LINK LAYER - Building a
network – Requirements - Layering and protocols -
Internet Architecture – Network software –
Performance ; Link layer Services - Framing - Error
Detection - Flow control
• UNIT II MEDIA ACCESS & INTERNETWORKING -
Media access control - Ethernet (802.3) - Wireless
LANs- 802.11 – Bluetooth - Switching and bridging –
Basic Internetworking (IP, CIDR, ARP, DHCP,ICMP )
• UNIT III ROUTING - Routing (RIP, OSPF, metrics) –
Switch basics – Global Internet (Areas, BGP, IPv6),
Multi cast addresses – multicast routing (DVMRP,
PIM)
10
Chapter 1
Contd.
• UNIT IV TRANSPORT LAYER - Overview of
Transport layer - UDP - Reliable byte stream (TCP)
- Connection management – Flow control -
Retransmission – TCP Congestion control -
Congestion avoidance (DECbit, RED) – QoS –
Application requirements
11
Chapter 1
Requirements for Building a
network
Perspectives
• Circuit Switched –
dedicated
link
• Packet Switched – store
(a) Point-to-point and forward
⮚Message stream channel does not guarantee delivery of all data but assures
in-order delivery, required in applications like video conferencing.
Protocols
• Protocol defines the interfaces between the
layers in the same system and with the layers
of peer system.
• Building blocks of a network architecture
• Each protocol object has two different
interfaces
– service interface: operations on this protocol is in
same host
– peer-to-peer interface: messages exchanged with
peer
• Protocol Specification: prose, pseudo-code, state
transition diagram.
Interfaces
27
Chapter 1
Position of IPv4 in TCP/IP protocol suite
28
Application Programming Interface
• Socket
– The point where a local application process
attaches to the network
– An interface between an application and the
network
– An application creates the socket
• The interface defines operations for
– Creating a socket
– Attaching a socket to the network
– Sending and receiving messages through the
socket
– Closing the socket
Socket
• Socket Family
– PF_INET denotes the Internet family
– PF_UNIX denotes the Unix pipe facility
– PF_PACKET denotes direct access to the network
interface (i.e., it bypasses the TCP/IP protocol
stack)
• Socket Type
– SOCK_STREAM is used to denote a byte stream
– SOCK_DGRAM is an alternative that denotes a
message oriented service, such as that provided by
UDP
Client-Serve Model with TCP
Bind
– Binds the newly created socket to the specified
address i.e. the network address of the local
participant (the server)
– Address is a data structure which combines IP
and port
Listen
– Defines how many connections can be pending
on the specified socket
Performance
Bandwidth,Latency(delay)
Network as a pipe
Delay X Bandwidth
Electromagnetic spectrum
Links
47
Chapter 1
A frame in a character-oriented protocol
11.48
48
Chapter 1
Byte stuffing and unstuffing
Byte stuffing is the process of adding 1 extra byte
whenever there is a flag or escape character in the text.
49
Chapter 1
PPP frame format
11.50
50
Chapter 1
A frame in a bit-oriented protocol
High-level Data Link Control (HDLC) is a bit-oriented protocol
for communication over point-to-point and multipoint links.
❖Configurations and Transfer Modes
Frames
Control Field
11.51
51
Chapter 1
Bit stuffing and unstuffing
11.52
52
Chapter 1
53
Chapter 1
Normal response mode
11.54
54
Chapter 1
Asynchronous response mode
55
Chapter 1
Asynchronous balanced mode
11.56
56
Chapter 1
HDLC(High level data link control) frames
11.57
57
Chapter 1
Control field format for the different frame types
N(s) – sequence no. of the frame sent N(R) – sequence no. of the frame expected
Poll/Final bit
11.58
58
Chapter 1
U-frame control command and response
11.59
59
Chapter 1
Error Detection
• Common technique for detecting transmission error
– CRC (Cyclic Redundancy Check)
• Used in HDLC, DDCMP (Digital Data Communication
Protocol), CSMA/CD, Token Ring
– Other approaches
• Two Dimensional Parity (BISYNC- Binary Synchronous
Communication)
• Checksum (IP)
60
Chapter 1
Error Detection
• Extra bits are redundant
– They add no new information to the message
– Derived from the original message using some
algorithm
– Both the sender and receiver know the algorithm
Sender Receiver
m r m r
61
Chapter 1
Types of Errors
• Single-bit errors
• Burst errors
62
62
Chapter 1
Common Error Detection Methods
• Vertical Redundancy Check
• Checksum
63
63
Chapter 1
Vertical redundancy Check
64
64
Chapter 1
Longitudinal redundancy Check
Block of bits divided in to rows
32bits = 4 rows X 8bits
67
67
Chapter 1
Cyclic Redundancy Check
• In a cyclic code, rotating a codeword always results
in another codeword. Cyclically left shift(rotated)
• Example:
68
68
Chapter 1
CRC Encoder/Decoder
69
69
Chapter 1
CRC Generator
70
70
Chapter 1
Checking CRC
71
71
Chapter 1
Number of Redundant Bits
Number of Number of Total
data bits redundancy bits bits
k r k+r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11
72
72
Example
Let us trace the path of three datawords from the sender to the
destination:
74
Chapter 1
Hamming Code
• Simple, powerful FEC
• Widely used in computer memory
error-correcting
bits
75
75
Chapter 1
Redundant Bit Calculation
76
76
Chapter 1
Example: Hamming Code
77
77
Chapter 1
Example: Correcting Error
• Receiver receives 10010100101
78
78
Chapter 1
FLOW AND ERROR CONTROL
The most important responsibilities of the data link
layer are flow control and error control. Collectively,
these functions are known as data link control.
11.79
79
Chapter 1
Flow control techniques
• Stop and wait, Sliding window
81
Stop and Wait Protocol
• Solution
– Use 1 bit sequence number (0 or 1)
– When the sender retransmits frame 0, the receiver can determine
that it is seeing a second copy of frame 0 rather than the first copy of
frame 1 and therefore can ignore it (the receiver still acknowledges it,
in case the first acknowledgement was lost)
83
Stop and Wait Protocol
Sliding Window Protocol
86
Chapter 1
ERROR CONTROL
87
Chapter 1
❖ERROR detection and correction
❖Allows the sender to know about damaged or lost
frame.
❖NAK (negative acknowledgement ) is sent when
an error is detected
❖STOP AND WAIT ARQ
❖It adds simple error control mechanism to stop
and wait protocol.
❖Lost acknowledgement (timer )
88
Chapter 1
89
Chapter 1
GO BACK N ARQ: Sender starts retransmission with the last
unacknowledged frame
90
Chapter 1
Damaged frame
91
Chapter 1
SELECTIVE REPEAT ARQ:
Specific damaged or lost frame is retransmitted
92
Applications
• Most people know about the Internet (a computer
network) through applications
– World Wide Web
– Email
– Online Social Network
– Streaming Audio Video
– File Sharing
– Instant Messaging