You are on page 1of 282

COMPUTER NETWORKS

(Reg: GR15A2077, B.Tech. CSE/IT/ECE)

Dr.G.S.Bapi Raju.
Prof., Dept. of CSE, GRIET, HYD.

Gokaraju Rangaraju Institute of Engineering and Technology.


Survey No. 288, Nizampet-Bachupally Road, Bachupally,
Kukatpally, Hyderabad, Telangana 500090.
PREFACE

About Computer Networks:

The significance of computer networks has drastically changed over the past decade due to
advancements in mobile communication and the Internet. Moving from the fourth generation
to fifth generation communication standards should definitely make a big change which was
never even thought in the early days. The future is moving to cloud technologies demanding
more sophisticated hardware, higher bandwidths and high performance infrastructure. The
abnormal growth in the usage of internet is mainly due to the availability of internet services
at affordable prices and easy access through smartphones, laptops, and tablets. Social sites, E-
commerce, digital money transfers, etc. all are complementing the growth of the internet. As
per a recent survey statistics, the usage of internet is going to be manifold in the next five
years.

About this book:

With my two decades of teaching experience, I am writing this book to help the students for
easy understanding and keeping their semester exams in mind. This book is specifically
written for the GR15A2077 regulation syllabus. Considerable time is devoted, collecting and
segregating numerous semester end question papers from various universities. Answers to all
these questions are included in this book and the respective page numbers are mentioned in
the table at the end of the book.

Acknowledgements:

I am immensely thankful and gratefully acknowledge the support and encouragement


rendered by our Director Prof. P.S.Raju, Principal Dr. Jandhyala N Murthy and Sr.
Administration officer Dr.K.V.S.Raju.

I owe much and place my profound gratitude to my students, colleagues, Faculty members of
the CSE department and our Head of the department Dr.Ch.Mallikarjuna Rao.

Dr. G.S.Bapiraju
Prof., Dept. of CSE
CONTENTS

1. INTRODUCTION TO NETWORKS AND MODELS .................................................... 1


Use of Computer Networks ....................................................................................................... 1
Goals: ..................................................................................................................................... 1
Applications ........................................................................................................................... 1
How Networks are part of our life: ........................................................................................ 1
Network Operating System: ................................................................................................... 2
i). Peer-to-Peer: .................................................................................................................. 2
ii). Client/Server:................................................................................................................ 3
Types of Networks / Categories of Networks. ....................................................................... 4
i). Local Area Networks (LAN) ......................................................................................... 4
ii). Metropolitan Area Network (MAN) ............................................................................ 4
iii). Wide Area Network..................................................................................................... 5
Difference between connection oriented (CO) and connectionless networks (CL) .............. 5
Network Topologies............................................................................................................... 6
Types of Topologies .............................................................................................................. 6
i). Bus Topology ................................................................................................................ 6
ii). Ring Topology .............................................................................................................. 6
iii). Star Topology .............................................................................................................. 6
iv). Mesh Topology ............................................................................................................ 7
v). Tree Topology: ............................................................................................................. 7
Layered Architecture ............................................................................................................. 7
Advantages of a layered architecture ................................................................................. 7
Disadvantages of a layered architecture............................................................................. 8
Reference Models .................................................................................................................. 8
OSI Model .............................................................................................................................. 8
1. The Physical Layer ........................................................................................................ 8
2. The Data Link Layer ...................................................................................................... 9
3. The Network Layer ........................................................................................................ 9
4. The Transport Layer....................................................................................................... 9
5. The Session Layer .......................................................................................................... 9
6. The Presentation Layer .................................................................................................. 9
7. The Application Layer ................................................................................................... 9

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


Dialog control in session layer ............................................................................................... 9
i). Simplex .......................................................................................................................... 9
ii). Duplex or Half duplex .................................................................................................. 9
iii). Full Duplex .................................................................................................................. 9
TCP/IP Protocol suite .......................................................................................................... 10
1. Physical and Data Link Layers .................................................................................... 10
2. Internetworking Protocol (IP) ...................................................................................... 10
3. Transport Layer ............................................................................................................ 11
4. Application Layer ........................................................................................................ 11
OSI and TCP/IP Comparison ........................................................................................... 11
Similarities between the OSI and TCP/IP Reference models ...................................... 11
Differences between the OSI and TCP/IP Reference models ...................................... 12

OSI Model concepts ............................................................................................................. 12


Examples of Networks. ........................................................................................................ 13
i). Novell NetWork .......................................................................................................... 13
ii). ARPANET.................................................................................................................. 14
iii). NSFNET .................................................................................................................... 14
iv). INTERNET................................................................................................................ 15
ATM..................................................................................................................................... 17
ATM Virtual Circuit ........................................................................................................ 17
The ATM Reference Model ............................................................................................. 18
The ATM layers and sub-layers and their functions ........................................................ 18
i). The physical layer.................................................................................................... 18
ii). The ATM layer ....................................................................................................... 18
iii). The ATM Adaptation Layer (AAL) ...................................................................... 19

QoS in ATM ........................................................................................................................ 20


ATM Service Categories / Flow Classes ......................................................................... 20
i). CBR ......................................................................................................................... 20
ii). VBR ........................................................................................................................ 20
iii). ABR ....................................................................................................................... 20
iv). UBR ....................................................................................................................... 20

2. THE PHYSICAL LAYER ................................................................................................ 21


Transmission media: ............................................................................................................ 21
Guided media ....................................................................................................................... 21
a). Twisted pair .................................................................................................................... 21

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


i). Shielded Twisted Pair (STP) ....................................................................................... 22
ii). Unshielded twisted pair (UTP) ................................................................................... 22
Categories of Unshielded Twisted Pair........................................................................ 22

b). Coaxial ............................................................................................................................ 23


i). Thin Coaxial (RG 58) .............................................................................................. 23
ii). Thick Coaxial (RG 11) ........................................................................................... 23

c). Fiber optic ....................................................................................................................... 24


Fiber optic cables ......................................................................................................... 24
Light Source ................................................................................................................. 25

Light propagation methods .................................................................................................. 25


i). Single mode fiber ........................................................................................................ 25
ii). Multimode fiber .......................................................................................................... 25
a). Step index multimode fiber..................................................................................... 25
b). Graded index multimode fiber ................................................................................ 26

Comparison / Differences between Copper wire and Fiber optic ....................................... 26


Electro Magnetic spectrum .................................................................................................. 27
Unguided media (wireless) .................................................................................................. 28
i). Radio Waves ................................................................................................................ 28
ii). Microwave .................................................................................................................. 28
iii). Infrared Waves .......................................................................................................... 29
iv). Lightwave Transmission ........................................................................................... 29
Communication Satellites .................................................................................................... 30
i). GEO or Geo stationary Earth Orbit ............................................................................. 30
ii). MEO or Medium Earth Orbit ..................................................................................... 31
Global Positioning System ........................................................................................... 31

iii). LEO or Low Earth Orbit: .......................................................................................... 32


Iridium System ............................................................................................................. 32
Globalstar ..................................................................................................................... 33

THE PUBLIC SWITCHED TELEPHONE NETWORK .................................................... 34


1. Multiplexing..................................................................................................................... 35
i). Frequency-division multiplexing................................................................................. 35
The Analog Carrier System ......................................................................................... 35
Digital Signal Service (Digital Hierarchy): T1 lines ................................................... 37

ii). Wavelength-Division Multiplexing ............................................................................ 38

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


iii). Time-Division Multiplexing. .................................................................................... 39
a). Synchronous time division multiplexing ................................................................ 39
b). Statistical Time-Division Multiplexing .................................................................. 40

2. Switching ......................................................................................................................... 41
i). Circuit switching ......................................................................................................... 41
ii). Message switching ..................................................................................................... 41
iii). Packet Switching ....................................................................................................... 42
Datagram Networks ......................................................................................................... 42
3. SONET / SDH.................................................................................................................. 43
THE MOBILE TELEPHONE NETWORK ........................................................................ 44
IMTS (Improved Mobile Telephone System) .................................................................. 44
Advanced Mobile Phone System (AMPS)....................................................................... 44
Frequency-Reuse Principle .............................................................................................. 44
D-AMPS: The Digital Advanced Mobile Phone System ................................................ 45
GSM: .................................................................................................................................... 46
GSM Architecture ............................................................................................................ 46
1. Base Station Subsystem (BSS) ................................................................................ 47
2. Network Switching Subsystem (NSS) ..................................................................... 48
3. Operational Support Subsystem (OSS) .................................................................... 48

Handoff ................................................................................................................................ 48
i). Hard Handoff ............................................................................................................... 49
ii). Soft Handoff ............................................................................................................... 49
Generations .......................................................................................................................... 49

3. DATA LINK LAYER ........................................................................................................ 51


Design Issues ....................................................................................................................... 51
Services Provided to the Network Layer ............................................................................. 51
i). Unacknowledged connectionless service .................................................................... 51
ii). Acknowledged connectionless service ....................................................................... 51
iii). Connection-oriented service ...................................................................................... 51
Framing ................................................................................................................................ 52
a). Fixed-Size Framing..................................................................................................... 52
b). Variable-Size Framing ................................................................................................ 52
1. Character count ........................................................................................................ 52
2. Byte stuffing (Character stuffing) ............................................................................ 53
3. Bit stuffing ............................................................................................................... 53

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


4. Physical layer coding violations .............................................................................. 54

Error Control ........................................................................................................................ 54


Flow Control ........................................................................................................................ 55
a). Feedback-based flow control ...................................................................................... 55
b). Rate-based flow control .............................................................................................. 55
Error Detection and Correction ............................................................................................ 55
i). Vertical redundancy check (VRC) .............................................................................. 56
ii). Longitudinal redundancy check (LRC): ..................................................................... 57
iii). Cyclic redundancy check (CRC): .............................................................................. 57
Polynomial ................................................................................................................... 58
CRC division using polynomials ................................................................................. 58
Advantages of Cyclic Codes ........................................................................................ 59

iv). Checksum .................................................................................................................. 60


v). Internet Checksum ...................................................................................................... 60
Error Correction ................................................................................................................... 61
1. Retransmission ............................................................................................................. 61
2. Forward Error Correction ............................................................................................ 61
Elementary Data Link Protocols .......................................................................................... 61
Noiseless Channels .......................................................................................................... 61
i). Unrestricted Simplex Protocol ................................................................................ 61
ii). A Simplex Stop-and-Wait Protocol:....................................................................... 62

Sliding Window Protocols for Noisy Channels ............................................................... 63


i). Stop-and-Wait ARQ ................................................................................................ 63
ii). Go-Back-N ARQ .................................................................................................... 64
iii). Selective Repeat ARQ ........................................................................................... 65

Piggybacking: ...................................................................................................................... 66

4. MEDIUM ACCESS SUB LAYER ................................................................................... 67


Channel Allocation .............................................................................................................. 67
i). Static channel allocation .............................................................................................. 67
ii). Dynamic Channel Allocation ..................................................................................... 67
Multiple Access Protocols ................................................................................................... 68
Random Access Protocols.................................................................................................... 68
ALOHA............................................................................................................................ 68
i). Classical (Pure) Aloha ............................................................................................. 69

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


ii). Slotted Aloha .......................................................................................................... 71

Carrier Sense Multiple Access Protocols (CSMA) .............................................................. 72


i). 1-persistent CSMA. ................................................................................................. 73
ii). p-persistent CSMA. ................................................................................................ 73
iii). non-persistent CSMA. ........................................................................................... 73

CSMA/CD........................................................................................................................ 74
The Binary Exponential Backoff Algorithm. ................................................................... 75
CSMA/CA........................................................................................................................ 76
Collision Free Protocols ....................................................................................................... 77
i). Bit map protocol .......................................................................................................... 77
ii). Binary Countdown ..................................................................................................... 77
Controlled (schedule) Access Protocols. ......................................................................... 78
i). Reservation. ............................................................................................................. 78
ii). Polling. ................................................................................................................... 78
iii). Token Passing. ...................................................................................................... 79

Channelization ................................................................................................................. 80
i). Frequency-Division Multiple Access (FDMA). ...................................................... 80
ii). Time-Division Multiple Access (TDMA). ............................................................. 80
iii). Code-Division Multiple Access (CDMA)............................................................. 81

IEEE 802.X ......................................................................................................................... 83


1. Data Link Layer ........................................................................................................... 84
i). Logical Link Control (LLC) .................................................................................... 84
ii). Media Access Control (MAC) ............................................................................... 85

2. Physical Layer .............................................................................................................. 85


Standard Ethernet ................................................................................................................. 85
Encoding in a Standard Ethernet implementations .......................................................... 86
i). Manchester encoding ............................................................................................... 87
ii). Differential Manchester encoding .......................................................................... 87

The Ethernet MAC Sublayer Protocol ................................................................................. 87


Ethernet Frame format. .................................................................................................... 87
IEEE 802.3 Frame ............................................................................................................ 88
Frame Length ................................................................................................................... 88
i). Minimum frame length ............................................................................................ 89
ii). Maximum length of a frame ................................................................................... 89

Fast Ethernet (802.3u) ...................................................................................................... 90

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


Gigabit Ethernet (802.3z) ................................................................................................. 91
Switched Ethernet ............................................................................................................ 92
Types of Switches ............................................................................................................ 93
i). Cut Through Switching ........................................................................................... 93
ii). Store and Forward Switching ................................................................................. 93
iii). Fragment-Free Switching (Hybrid) ....................................................................... 93

5. IEEE 802.11 (Wireless LAN) ............................................................................................ 95


The 802.11 Protocol Stack ................................................................................................... 95
IEEE 802.11 MAC Sublayers .............................................................................................. 95
a). Distributed Coordination Function (DCF) .................................................................. 95
i). Frame Exchange ...................................................................................................... 95
ii). Network Allocation Vector .................................................................................... 96
iii). Collision During Handshaking .............................................................................. 96

b). Point Coordination Function (PCF) ............................................................................ 97


Frame Format ................................................................................................................... 98
Hidden and exposed terminals ............................................................................................. 99
i). Hidden Station Problem .............................................................................................. 99
MACA and MACAW .................................................................................................. 99

ii). Exposed station problem .......................................................................................... 100


Services .......................................................................................................................... 101
1. Distribution services .............................................................................................. 101
2. Station services ...................................................................................................... 101

Physical Layer ................................................................................................................ 102


Bluetooth (IEEE 802.15) ................................................................................................. 103
i). Piconets...................................................................................................................... 103
ii). Scatternet .................................................................................................................. 103
Bluetooth Protocol Stack (Layers) ..................................................................................... 104
i). Radio Layer ........................................................................................................... 104
ii). Baseband Layer .................................................................................................... 104
iii). L2CAP ................................................................................................................. 105

Frame Structure .............................................................................................................. 106


Data Link Layer Switching ................................................................................................ 107
Bridges ........................................................................................................................... 107
i). Transparent Bridges............................................................................................... 107

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


ii). Source Routing Bridges........................................................................................ 109
iii). Spanning tree bridges (802.1D) .......................................................................... 109
iv). Remote Bridges ................................................................................................... 110

Local Internetworking ........................................................................................................ 111


Networking /Internetworking Devices ............................................................................... 112
i). Passive Hubs .............................................................................................................. 112
ii). Repeaters .................................................................................................................. 112
iii). Layer 2 Switch or Bridge ........................................................................................ 112
iv). Router (Three-Layer Switches) ............................................................................... 113
v). Gateway .................................................................................................................... 113
Virtual LANs (802.1Q) ...................................................................................................... 114
i). VLANs create broadcast domains ............................................................................. 114
ii). Membership .............................................................................................................. 115
iii). Configuration .......................................................................................................... 115
iv). Communication Between Switches ......................................................................... 115

6. NETWORK LAYER ....................................................................................................... 117


Network Layer Design Issues ............................................................................................ 117
i). Connection Oriented Service ..................................................................................... 117
ii). Connectionless Service............................................................................................. 118
Difference between Virtual-Circuit and Datagram Subnets .............................................. 119
Routing Algorithms ........................................................................................................... 120
The Optimality Principle............................................................................................ 120
Sink tree ..................................................................................................................... 120

1. Non-adaptive (Static routing) algorithms ...................................................................... 121


Shortest Path Routing. ................................................................................................... 121
a). Dijkstra Algorithm .................................................................................................... 121
Flooding vs Broadcast................................................................................................ 122

b). Flooding .................................................................................................................... 123


Measures to control flooding ..................................................................................... 123
Reverse path forwarding ............................................................................................ 124

2. Adaptive (Dynamic routing) algorithms ........................................................................ 125


a). Distance Vector Routing ........................................................................................... 125
i). Initialization ........................................................................................................... 125
ii). Sharing.................................................................................................................. 125

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


iii). Updating .............................................................................................................. 125

The Count-to-Infinity Problem ...................................................................................... 126


Solutions for count to infinity problem ...................................................................... 127
i). Defining Infinity .................................................................................................... 127
ii). Split Horizon ........................................................................................................ 127
iii). Split Horizon and Poison Reverse ....................................................................... 127

b). Link State Routing .................................................................................................... 128


i). Sharing knowledge about the neighborhood ......................................................... 128
ii). Sharing with every other router ............................................................................ 128
iii). Sharing when there is a change ........................................................................... 128

Hierarchical Routing. ..................................................................................................... 129


Broadcast routing ........................................................................................................... 130
Multicast routing ............................................................................................................ 131
Routing for Mobile hosts ............................................................................................... 132
Routing in Adhoc Networks .......................................................................................... 133
AODV (Ad hoc On-demand Distance Vector) routing algorithm ............................. 133

7. CONGESTION CONTROL ........................................................................................... 135


Congestion Control Algorithms ......................................................................................... 135
Reasons for congestion .................................................................................................. 135
i). Memory ................................................................................................................. 135
ii). Slow processors can also cause congestion .......................................................... 135
iii). Low-bandwidth lines ........................................................................................... 135

General Principles of Congestion Control ......................................................................... 136


i). Open loop .............................................................................................................. 136
ii). Closed loop ........................................................................................................... 136

Congestion Prevention Policies ......................................................................................... 137


i). In the data link layer: ............................................................................................. 137
ii). In the network layer:............................................................................................. 137
iii). In the transport layer: .......................................................................................... 138

Congestion Control in Virtual-Circuit Subnets.................................................................. 139


Admission control. ......................................................................................................... 139
Congestion Control in Datagram Subnets.......................................................................... 140
i). The Warning Bit .................................................................................................... 140
ii). Choke Packets ...................................................................................................... 140

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


iii). Load Shedding..................................................................................................... 140
iv). Random Early Detection (RED) .......................................................................... 140

Jitter Control ...................................................................................................................... 141


Quality Of Service (QoS)................................................................................................... 142
Flow Characteristics ....................................................................................................... 142
i). Reliability .............................................................................................................. 142
ii). Delay .................................................................................................................... 142
iii). Jitter ..................................................................................................................... 142
iv). Bandwidth............................................................................................................ 142

Techniques to Improve QoS .............................................................................................. 143


i). Buffering.................................................................................................................... 143
ii). Traffic Shaping ......................................................................................................... 144
a). Leaky Bucket ........................................................................................................ 144
b). Token Bucket ........................................................................................................ 144

iii). Admission Control .................................................................................................. 145


iv). Resource Reservation .............................................................................................. 145
v). Packet Scheduling..................................................................................................... 146
a). FIFO Queuing ....................................................................................................... 146
b). Priority Queuing ................................................................................................... 146
c). Weighted Fair Queuing ......................................................................................... 146

Quality of service in the Internet ....................................................................................... 147


i). Integrated Services .................................................................................................... 147
ii). Differentiated Services ............................................................................................. 149

8. THE NETWORK LAYER IN THE INTERNET ......................................................... 151


IP Addresses....................................................................................................................... 152
IP address formats .......................................................................................................... 152
Special IP addresses ....................................................................................................... 152
i). Subnets. ......................................................................................................................... 153
ii). CIDR (Classless Inter Domain Routing) ...................................................................... 154
iii). Network Address Translation (NAT) .......................................................................... 155
Translation Table ........................................................................................................... 156
Using Both IP Addresses and Port Numbers ................................................................. 156
Internet Control Protocols .................................................................................................. 157
a). ICMP ......................................................................................................................... 157

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


i). The error-reporting messages ................................................................................ 157
ii). The query messages.............................................................................................. 157

b). IGMP ........................................................................................................................ 158


Static and Dynamic Mapping............................................................................................. 160
i). ARP : ......................................................................................................................... 160
ii). RARP........................................................................................................................ 161
iii). BOOTP .................................................................................................................... 161
iv). DHCP ...................................................................................................................... 162
Autonomous Systems......................................................................................................... 163
Types of Autonomous Systems ..................................................................................... 163
i). Stub AS.................................................................................................................. 163
ii). Multi homed AS ................................................................................................... 163
iii). Transit AS ........................................................................................................... 163

Intra (Interior) and Inter (Exterior) domain Routing protocols ......................................... 164
1. Intra domain Routing: .................................................................................................... 165
a). RIP ............................................................................................................................ 165
b). OSPF ......................................................................................................................... 166
Types of Links ........................................................................................................... 167

2. Inter domain Routing: .................................................................................................... 168


a). BGP ........................................................................................................................... 168
Path Vector Routing ................................................................................................... 168
BGP Sessions ............................................................................................................. 170

Mobile IP ........................................................................................................................... 171


IPV4 ................................................................................................................................... 172
IPv6 .................................................................................................................................... 174
IPv4 vs IPv6 ............................................................................................................... 175
Transition from IPV4 to IPV6 ........................................................................................... 177
i). Dual Stack ................................................................................................................. 177
ii). Tunneling.................................................................................................................. 177
iii). Header Translation .................................................................................................. 178

9. THE TRANSPORT LAYER .......................................................................................... 179


Services Provided to the Upper Layers .............................................................................. 179
Transport Service Primitives.............................................................................................. 179
Berkeley Sockets ................................................................................................................ 181

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


Elements of Transport Protocols ............................................................................................ 182
i). Addressing (port) ........................................................................................................... 182
Initial connection protocol ............................................................................................. 182
ii). Connection Establishment ............................................................................................ 183
The three-way handshake method ............................................................................. 183

iii). Connection Release ..................................................................................................... 184


Asymmetric Release ...................................................................................................... 184
Symmetric Release ......................................................................................................... 184
(a) Normal case of three-way handshake ................................................................... 184
(b) Final ACK lost ..................................................................................................... 184
(c) Response lost ........................................................................................................ 184
(d) Response lost and subsequent DRs lost ............................................................... 184

iv). Flow Control and Buffering ........................................................................................ 185


a). Flow control .............................................................................................................. 185
b). Buffering ................................................................................................................... 185
(i) Chained fixed-size buffers .................................................................................... 185
(ii) Chained variable-sized buffers............................................................................. 185
(iii) One large circular buffer per connection ............................................................ 185

v). Multiplexing ............................................................................................................. 186


a). Upward multiplexing ............................................................................................ 186
b). Downward multiplexing ....................................................................................... 186

vi). Crash Recovery ....................................................................................................... 187


i). First sends an acknowledgement, and then write .................................................. 187
ii). First write and then send the acknowledgement .................................................. 187

The Internet Transport Protocols ........................................................................................... 188


Introduction to UDP ........................................................................................................... 188
a). The UDP Header ....................................................................................................... 188
b). RPC Remote Procedure Call .................................................................................... 189
c). The Real-Time Transport Protocol (RTP) ................................................................ 190
The RTP Header ................................................................................................................ 191
Introduction to TCP ........................................................................................................... 192
TCP Services .................................................................................................................. 192
The TCP Protocol. ......................................................................................................... 193
The TCP Segment Header.............................................................................................. 193
TCP Connection Establishment (Three way hand shake). ............................................. 195

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


TCP Connection Release. .............................................................................................. 195
TCP Connection Management ....................................................................................... 196
Connection management from the Client side ........................................................... 196
Connection management from the Server side .......................................................... 197

TCP Transmission Policy. ............................................................................................. 198


TCP Congestion Control (slow start) ............................................................................. 199
Wireless TCP and UDP ................................................................................................. 200
Indirect TCP ................................................................................................................... 200
Transactional TCP ......................................................................................................... 201

10. THE APPLICATION LAYER ..................................................................................... 203


DNS (The Domain Name System) .................................................................................... 203
The DNS Name Space ................................................................................................... 204
Name server & Distribution of Name Space ................................................................. 204
Hierarchy of Name Servers ............................................................................................ 204
Primary and Secondary DNS Servers ............................................................................ 205
Resource Records ........................................................................................................... 205
Fully Qualified Domain Name (FQDN) ........................................................................ 206
Partially Qualified Domain Name (PQDN) ................................................................... 206
Electronic Mail....................................................................................................................... 207
a). User Agent .................................................................................................................... 207
b). Message Transfer agent ................................................................................................ 207
MIME ......................................................................................................................... 208
Message Transfer: The Simple Mail Transfer Protocol (SMTP)............................ 209

c). Message Access Agent (Final Delivery) ...................................................................... 209


i). POP3 (Post Office Protocol Version 3) .................................................................... 209
ii). IMAP (Internet Message Access Protocol) .............................................................. 210
A comparison of POP3 and IMAP ................................................................................. 210
Web-Based Mail ................................................................................................................ 210
The World Wide Web ........................................................................................................ 211
URL (Uniform Resource Locator) ..................................................................................... 211
Functioning of a Web Browser .......................................................................................... 212
The Client Side .............................................................................................................. 212
The Server Side .............................................................................................................. 212
Cookies .............................................................................................................................. 213

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


Creation and Storage of Cookies ................................................................................... 213
Types of cookies ............................................................................................................ 213
Advantages and disadvantages of cookies ..................................................................... 213
HTML (The Hyper Text Markup Language)..................................................................... 214
XML and XSL ................................................................................................................... 214
XHTML ............................................................................................................................. 214
WEB DOCUMENTS ......................................................................................................... 215
i). Static Documents ....................................................................................................... 215
ii). Dynamic Documents ................................................................................................ 215
iii). Active Documents ................................................................................................... 215
HTTP.................................................................................................................................. 216
Performance Enhancements ............................................................................................... 217
i). Caching ...................................................................................................................... 217
ii). Server replication (or mirroring) .............................................................................. 217
iii). Content delivery networks (CDN) .......................................................................... 218
WAP (The Wireless Application Protocol) ....................................................................... 218

11. MULTIMEDIA .............................................................................................................. 221


Introduction to digital audio............................................................................................... 221
1. Audio Compression ....................................................................................................... 222
a). Predictive Encoding .................................................................................................. 222
b). Perceptual Encoding ................................................................................................. 222
Streaming audio ................................................................................................................. 223
Internet radio ...................................................................................................................... 224
Voice Over IP (Internet telephony).................................................................................... 225
a). SIP ............................................................................................................................. 225
Addresses: (Formats) ................................................................................................. 226

b). H.323 ........................................................................................................................ 227


Introduction to video .............................................................................................................. 228
i). Joint Photographic Experts Group (JPEG) .................................................................... 228
a). Discrete Cosine Transform (DCT) ....................................................................... 228
c). Compression ......................................................................................................... 228

ii). The MPEG Standard .................................................................................................... 229


a). Spatial Compression ................................................................................................. 229

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


b). Temporal Compression............................................................................................. 229
I-frames ...................................................................................................................... 229
P-frames ..................................................................................................................... 229
B-frames:.................................................................................................................... 229
D-frames .................................................................................................................... 229
MPEG Frame construction ........................................................................................ 229

Video on demand ............................................................................................................... 230


The MBone (The Multicast Backbone) ............................................................................ 231

12. CRYPTOGRAPHY ....................................................................................................... 233


Cryptography ..................................................................................................................... 233
Ciphertext ....................................................................................................................... 233
Cipher ............................................................................................................................. 233
Two Categories of cryptography ....................................................................................... 233
Symmetric key cryptography ................................................................................................. 234
i). Traditional Ciphers ........................................................................................................ 234
a). Substitution ciphers................................................................................................... 234
i). Monoalphabetic ciphers......................................................................................... 234
ii). Polyalphabetic ciphers .......................................................................................... 234
iii). Shift cipher (Caesar cipher)................................................................................. 235

b). Transposition Ciphers ............................................................................................... 235


One time Pads (XOR Cipher) ............................................................................................ 236
Quantum cryptography ...................................................................................................... 237
Two Fundamental Cryptographic Principles ..................................................................... 238
i). Redundancy ............................................................................................................... 238
ii). Freshness .................................................................................................................. 238

QUESTION BANK .............................................................................................................. 239


SYLLABUS .......................................................................................................................... 251
MODEL QUESTION PAPERS .......................................................................................... 253
Model Paper - 01 ................................................................................................................ 255
Model Paper - 02 ................................................................................................................ 257
Model Paper - 03 ................................................................................................................ 259
Model Paper - 04 ................................................................................................................ 261

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.


Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad.
1. INTRODUCTION TO NETWORKS AND MODELS

Use of Computer Networks

Goals:

i). Sharing expensive or scarce resources: Resources like printers, scanners or any special
software or hardware equipment or even broadband connection can be shared by all the users
within a network.

ii). Exchange of Data: A common database is maintained and the users can exchange this
data at any time between any users. Certain data can also be restricted to specific users only.

iii). Data Reliability: The crucial data can be stored on various servers at different locations
to avoid any threats caused by humans or by any natural calamities.

iv). Performance: The work can be segmented and assign to different people so that it can be
processed in parallel.

v). Accessibility: The users can access the database and can work from home, office or from
any part of the world.

Applications:

i). Access to remote databases: The Internet provides connectivity to huge repositories.

ii). Access to online websites: Applications like online ticketing, payments of utility bills or
any e-commerce are not possible without a network.

iii). Access to real-time information: Shares trading, weather conditions, news, Product
pricing etc. can be monitored real time

iv). Communication Facilities: whether wired or wireless the communication is possible


only if we have networks.

How Networks are part of our life:

The following are the most commonly used applications which are part of our life.

i). Online ticketing (cinema, bus, train…)


ii). Payment of utility bills.
iii). e-commerce
iv). E-mails,
v). Mobile communication.
vi). Entertainment (games, music or videos)
vii). Social sites (Facebook, twitter..)
viii). Audio or video chat (Skype) etc..

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 1


Network Operating System:

* Unlike operating systems, such as Windows, that are designed for single users to
control one computer, network operating systems (NOS) coordinate the activities of
multiple computers across a network. The network operating system acts as a master
to keep the network running smoothly.

The two major types of network operating systems are:

i). Peer-to-Peer
ii). Client/Server

i). Peer-to-Peer:

* Peer-to-peer network operating systems allow users to share resources and files
located on their computers and to access shared resources found on other computers.
However, they do not have a file server or a centralized management source.

* In a peer-to-peer network, all computers are considered equal; they all have the same
abilities to use the resources available on the network. Peer-to-peer networks are
designed primarily for small to medium local area networks. Nearly all modern
desktop operating systems, such as Windows, Linux, and Macintosh OSX, can
function as peer-to-peer network operating systems.

Fig. Peer to Peer Network.

Advantages of a peer-to-peer network:

Less expense: No need for a dedicated server.


Setup: Any existing operating system can be reconfigured for peer-to-peer operations.

Disadvantages of a peer-to-peer network:

Decentralized - No central repository for files and applications.


Security - Does not provide the security available on a client/server network.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 2


ii). Client/Server:
* Client/server network operating systems allow the network to centralize functions and
applications on one or more dedicated file server. The file servers become the heart of
the system, providing access to resources and providing security. Individual
workstations (clients) have access to the resources available on the file servers.

Fig. Client /Server Network

* The network operating system in the server provides the mechanism to integrate all
the components of the network and allow multiple users (clients) to simultaneously
share the same resources irrespective of physical location.

* UNIX/Linux and the Microsoft family of Windows Servers are examples of


client/server network operating systems.

Advantages of a client/server network:

Centralized - Resources and data security are controlled through the server.
Scalability - Any or all elements can be replaced individually as needs increase.
Flexibility - New technology can be easily integrated into the system.
Interoperability - All components (client/network/server) work together.
Accessibility - Server can be accessed remotely and across multiple platforms.

Disadvantages of a client/server network:

Expense - Requires initial investment in a dedicated server.


Maintenance - Large networks will require a staff to ensure efficient operation.
Dependence - When server goes down, operations will cease across the network.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 3


Types of Networks / Categories of Networks.

The category into which a network falls is determined by its size.

i). Local Area Networks (LAN)

* Local area networks are privately-owned networks within a single building or campus
used to connect personal computers in company offices and factories to share
resources (e.g., printers) and exchange information. LANs are distinguished from
other kinds of networks by three characteristics:

(1) Their size,


(2) Their transmission technology, and
(3) Their topology.

* LANs are restricted in size


normally less than one kilometer
and normally connect through
a cable.

* Support speeds up to 100 Mbps,


and newer LANs can operate up to
10 Gbps. Various topologies are
used in LANs.

ii). Metropolitan Area Network (MAN)

* A metropolitan area network, or MAN, covers a city. The best-known example of a


MAN is the cable television network available in many cities.

* In the figure both television signals and Internet are fed into the centralized
distribution to people's
homes.

* Recent developments in
high-speed wireless
Internet access resulted in
another MAN, which has
been standardized as
IEEE 802.16.

* A MAN is implemented by a standard called DQDB (Distributed Queue Dual


Bus) or IEEE 802.16. DQDB has two unidirectional buses (or cables) to which all
the computers are attached.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 4


iii). Wide Area Network

* A wide area network, or WAN, occupies a very large area, such as an entire country
or the entire world. A WAN can contain multiple smaller networks, such as LANs or
MANs. The Internet is the best-known example of a public WAN.

* A second possibility for a WAN is a satellite system. Satellite networks are inherently
broadcast and are most useful when the broadcast property is important.

* In the WAN‘s the packets are transported individually over the network and
deposited on the receiving host, where they are reassembled into the original message
and delivered to the receiving process. Not all WANs are packet switched.

Difference between connection oriented (CO) and connectionless networks (CL)

1. In connectionless communication, there is no need to establish connection between source


(sender) and destination (receiver). But in connection-oriented communication connection
must established before data transfer.

2. Connection-oriented communication is more reliable than connectionless communication.

3. In connection-oriented communication information can be resent if there is an error on the


receiver side (missing data, corrupt data etc.). But in connectionless communication it is not
possible because the destination does not inform about the source data is received or not.

4. Connection-oriented communication has higher overhead and place greater demands on


bandwidth. But in connectionless communication requires far less overhead than connection-
oriented communication.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 5


Network Topologies

Network Topology: A network topology is the arrangement of a network, including its work
stations / nodes and connecting lines. There are two ways of defining network geometry: the
physical topology and the logical (or signal) topology.

Logical (or signal) topology refers to the nature of the paths the signal flow from node to
node. In many instances, the logical topology is the same as the physical topology. But this is
not always the case. For example, some networks are physically laid out in a star
configuration, but they operate logically as bus or ring networks.

Types of Topologies

The physical topology of a network is the actual geometric layout of workstations. There are
several common physical topologies, as described and illustrated below.

i). Bus Topology: In a bus topology all devices


are connected to a central cable, called the bus or
backbone. This topology is relatively inexpensive
and easy to install for small networks. This is most
widely used in Ethernet, which is the dominant
LAN architecture.

The disadvantage is a simple cable cut stops the


entire network.

ii). Ring Topology: In a ring topology, each device is


connected directly to two other devices, one on either
side of it, to form a closed loop.

This topology is relatively expensive and difficult to


install, but it offers high bandwidth and can span large
distances.

A variation is the token ring, in which signals travel in


only one direction around the loop, carried by a so-called
token from node to node.

iii). Star Topology: In a star topology all devices are


connected directly to a computer or server through a
central device like a hub or switch.

Such networks are relatively easy to install and manage,


but bottlenecks can occur because all data must pass
through the central device. If the central hub fails, entire
network comes to standstill.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 6


iv). Mesh Topology: The mesh topology can be either a
full mesh or a partial mesh. In the former, each computer
is connected directly to each of the others. In the latter,
some computers are connected to most of the others, and
some are connected only to those other nodes with which
they exchange the most data.

Mesh topology is more reliable than other topologies


because it provides an alternative path when a cable cut
occurs. The disadvantage is mesh topology requires lot of
cable, which makes this option expensive.

v). Tree Topology: In Tree Topology, the number of star


networks is connected using Bus. This main cable acts like
a main stem of a tree, and other star networks as the
branches. It is also called Expanded Star Topology.

Ethernet protocol is commonly used in this type of


topology. The disadvantage is if any root or sub root system
fails, its entire connected branch systems also fail.

Layered Architecture:

* In layered architecture model, each layer is a collection or a group of specific


networking functions which had related uses.

* Each layer defines a family of functions distinct from those of the other layers. This
made this architecture, both comprehensive and flexible.

Advantages of a layered architecture:

Interoperability - Layering promotes greater interoperability between devices from different


manufacturers and even between different generations of the same type of device from the
same manufacturer.

Greater Compatibility - One of the greatest benefits of using a hierarchal or layered


approach is the greater compatibility between devices, systems and networks.

Portability - Layered networking protocols are much easier to port from one system or
architecture to another.

Scalability - Experience has shown that a layered or hierarchal approach to networking


protocol design and implementation scales better than the horizontal approach.

Mobility - Greater mobility is more readily delivered whenever we adopt the layered and
segmented strategies into our architectural design.

Task Segmentation - Breaking a large, complex system into smaller, more manageable
subcomponents allows for easier development and implementation of new technologies

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 7


Disadvantages of a layered architecture:

* There might be a negative impact on the performance as we have the extra overhead
of passing through layers instead of calling a component directly.

* Development of user-intensive applications can sometimes take longer.

* The use of layers helps to control and encapsulate the complexity of large
applications, but adds complexity to simple applications.

Reference Models

OSI Model: The seven layers of the OSI model:

* The OSI or Open System Interconnection model is developed by the International


Standards Organization (ISO). The OSI model defines a networking framework for
implementing protocols in seven layers.

* Control is passed from one layer to the next, starting at the application layer in one
station and proceeding to the bottom layer, over the channel to the next station and
back up the hierarchy.

1. The Physical Layer: Describes the physical properties of the various communications
media, as well as the electrical properties and interpretation of the exchanged signals. This
layer defines the type of transmission medium, Representation of bits, Data transfer rate,
Synchronization of bits, Physical topology.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 8


2. The Data Link Layer: Describes the logical organization of data bits transmitted on a
particular medium. Supports framing, error control and flow control. This layer defines the
framing, Physical addressing and error and flow control

3. The Network Layer: The network layer is responsible for the delivery of individual
packets from the source host to the destination host. This layer defines the Logical addressing
and routing structure of the Internet.

4. The Transport Layer: Describes the quality and nature of the data delivery. This layer
deals with end to end transmission. Supports error control and flow control. This layer
defines the segmentation and reassembly, connectionless and connection oriented network.

5. The Session Layer: The session layer is the network dialog controller. It establishes,
maintains, and synchronizes the interaction among communicating systems. The session layer
is responsible for dialog control and synchronization.

6. The Presentation Layer: The presentation layer is concerned with the syntax and
semantics of the information exchanged between two systems. It describes how translation,
Encryption and compression takes place.

7. The Application Layer: Describes how real work actually gets done. This layer would
implement file system operations.

1. File Transfer: It allows a user to access, retrieve and manage files on a remote computer.

2. Mail services: It provides the basis for email forwarding and storage facilities.

3. Directory services: It provides distributed database sources and access for global
information about various objects and services.

Dialog control in session layer: (Modes of communication):

Transmission mode describes the direction, of the flow of the signal between two connected
devices. There are three modes of transmission simplex, half duplex, and full duplex.

i). Simplex: In simplex mode the data flow is unidirectional or One way communication
Ex: Keyboard, Monitor

ii). Duplex or Half duplex: This mode supports bidirectional or two way communication,
but only one device can communicate at one time. Simultaneous data transfer cannot take
place.
Ex: Walkie talkie

iii). Full Duplex: full duplex mode supports bidirectional simultaneous data transfer.
Ex: Telephone

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 9


TCP/IP Protocol suite

The TCP/IP protocol suite was defined as having four layers: host-to-network, internet,
transport, and application.

1. Physical and Data Link Layers: At the physical and data link layers, TCP/IP does not
define any specific protocol. It supports all the standard and proprietary protocols. A network
in a TCP/IP internetwork can be a local-area network or a wide-area network.

2. Internetworking Protocol (IP): The Internetworking Protocol (IP) is the transmission


mechanism used by the TCP/IP protocols. It is an unreliable and connectionless protocol. IP
is a host-to-host protocol, meaning that it can deliver a packet from one physical device to
another. IP transports data in packets called datagrams, each of which is transported
separately.

Datagrams can travel along different routes and can arrive out of sequence or be duplicated.
IP does not keep track of the routes and has no facility for reordering datagrams once they
arrive at their destination.

Address Resolution Protocol (ARP): Address Resolution Protocol is used to find the
physical address of the node when its Internet address is known.

Reverse Address Resolution Protocol (RARP): The Reverse Address Resolution Protocol
allows a host to discover its Internet address when it knows only its physical address. It is
used when a computer is connected to a network for the first time or when a diskless
computer is booted.

Internet Control Message Protocol (ICMP): The Internet Control Message Protocol is a
used by hosts and gateways to send notification of datagram problems back to the sender.
ICMP send query and error reporting messages.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 10


Internet Group Message Protocol (IGMP): The Internet Group Message Protocol is used
to facilitate the simultaneous transmission of a message to a group of recipients.

3. Transport Layer: Transport layer was represented in TCP/IP by two protocols: TCP and
UDP. IP is a host-to-host protocol, UDP and TCP are process-to-process protocols,
responsible for delivery of a message from a process (running program) to another process.

User Datagram Protocol: The User Datagram Protocol (UDP) is an unreliable (connection
less) process-to-process protocol.

Transmission Control Protocol: The Transmission Control Protocol (TCP) is a reliable


stream (connection-oriented) transport protocol. A connection must be established between
both ends of a transmission before either can transmit data.

Stream Control Transmission Protocol: The Stream Control Transmission Protocol


(SCTP) provides support for newer applications such as voice over the Internet. It is a
transport layer protocol that combines the best features of UDP and TCP.

4. Application Layer: The application layer in TCP/IP is equivalent to the combined session,
presentation, and application layers in the OSI model many protocols are defined in this
layer.
Ex: HTTP, FTP, SMTP, DNS and Telnet etc.

OSI and TCP/IP Comparison

i). Host-to-network layer is equivalent to the combination of the physical and data link layers.

ii). The internet layer is equivalent to the network layer

iii). The application layer is equivalent to the session, presentation, and application layers

iv). The transport layer in TCP/IP is equivalent to transport layer.

Similarities between the OSI and TCP/IP Reference models

i). Both of the models share a similar architecture based on the concept of a stack of
independent protocols.

ii). Both of the models share a common "application layer". However, in practice this layer
includes different services depending upon each model.

iii). Whatever functions are performed between the presentation and the network layer of the
OSI model similar functions are performed at the Transport layer of the TCP/IP model.

iv). Both models assume that packets are switched: Basically, this means that individual
packets may take differing paths in order to reach the same destination.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 11


Differences between the OSI and TCP/IP Reference models.

i). TCP/IP Protocols are considered to be standards around which the internet has developed.
Where as the OSI model however is a "generic, protocol- independent standard."

ii). The OSI model clearly distinguishes between the services, the interface and protocols
where the TCP/IP model did not clearly distinguished.

iii). TCP/IP combines the presentation and session layer issues into its application layer.

iv). TCP/IP combines the OSI data link and physical layers in the network access layer.

v). The OSI model consists of 7 architectural layers, whereas the TCP/IP only has 4 layers.

OSI Model concepts

Three concepts are central to the OSI model:

i). Service: In OSI model each layer performs some services to the layer above it. The service
definition tells what the layer does. It is a program, routine, or process that performs a
specific system function to support other programs.

ii). Interface: A layer's interface tells the processes above it how to access it. It specifies
what the parameters are and what results to expect.

iii). Protocols: Protocol is the special set of rules that end points in a telecommunication
connection use when they communicate. In other words Protocol is an agreed-upon format
for transmitting data between two devices. The protocol determines the following:

- The type of error checking to be used


- Data compression method, if any
- How the sending device will indicate that it has finished sending a message
- How the receiving device will indicate that it has received a message

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 12


Examples of Networks.

i). Novell NetWork:

* Novell NetWare is based on the client/server model and uses a proprietary protocol
stack.

* The physical and data layers can be chosen from among various industry standards
(Ethernet, IBM token ring, ARCnet).

* The network layer runs an unreliable internetwork connectionless protocol called IPX,
functionally similar to IP.

* Above IPX comes a connection-oriented transport protocol called NCP (Network


Core Protocol) providing various other services besides user data transport. A second
protocol, SPX, is also available, but provides only transport.

* The session and presentation layers do not exist. Various application protocols are
present in the application layer.

The maximum size of the packet is determined by the underlying network.

* About once a minute, each server broadcasts a packet giving its address and telling
what services it offers (by using SAP - Service Advertising Protocol).

* The packets are collected by special agent processes running on the router machines.
The agents use the information contained in them to construct databases, of which
servers are running where.

When a client machine is booted, the following procedures take place:

1. The client machine broadcasts a request asking where the nearest server is.

2. The agent on the local router machine looks in its database of servers and the best choice
of server send back to the client.

3. The client establishes an NCP connection with the server. From this point on, the client can
access the file system and other services using this connection.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 13


ii). ARPANET: (Advanced Research Projects Agency Network)

* The ARPANET was the world's first operational packet switching network. Here
the information is sent in small units called “packets”, which are routed on
different paths and reconstructed at their destination. This was the basis for the
Internet. The first permanent ARPANET link was established on 21 November 1969.

* Initially ARPANET is used to share computer resources among mainly scientific


users/institutions, but with the development of the TCP/IP protocols, it led to expand
the size of the network into present internet.

* With packet switching, a data system could use one communication link to
communicate with more than one machine by collecting data into datagram’s and
transmit these as packets onto the attached network link.

Fig: The original ARPANET design:

* The subnet would consist of minicomputers called IMPs (Interface Message


Processors) connected by 56-kbps transmission lines.

* Every IMP is connected to at least two other IMPs for high reliability. So if some
lines or IMPs were destroyed, messages could be automatically rerouted along
alternative paths.

* The software address was split into two parts: subnet address and host address.
ARPANET was decommissioned in 1990.

iii). NSFNET:

* ARPANET was a grand success in sharing data and collaborate on research


projects, but being a DoD project its access is restricted and not freely available. This
led to the development of the NSFNET (the U.S. National Science Foundation) which
is open to all university research groups.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 14


* NSF developed a backbone network to connect its six supercomputer centers,
consisting of an LSI-11 microcomputer called a fuzzball. The fuzzballs were
connected with 56-kbps leased lines and formed the subnet, the same hardware
technology as the ARPANET used.

Fig. NSFNET

* The software technology was different, however: the fuzzballs spoke TCP/IP right
from the start, making it the first TCP/IP WAN.

* NSF was later expanded to allow users at thousands of universities, research labs,
libraries, and museums to access any of the supercomputers and to communicate with
one another.

* The complete network, including the backbone and the regional networks, was called
NSFNET. NSFNET was decommissioned in 1995.

iv). INTERNET

* The Internet is a vast collection of different networks. It is an unusual system in that it


was not planned by anyone and is not controlled by anyone.

* A machine is said to be on the Internet if it runs the TCP/IP protocol stack, has an IP
address, and can send IP packets to all the other machines on the Internet.

* Traditionally, the Internet and its predecessors had four main applications: Email,
News, Remote Login and File transfer. Popularly used by academic, government, and
industrial researchers.

* With the invention of World Wide Web (WWW) in 1980 by CERN physicist Tim
Berners-Lee made the net access easier and brought millions of new, nonacademic
users to the net.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 15


* A client calls the ISP over a dial-up telephone line, as shown in the below figure.

* Via Modem these signals are transferred to the ISP's POP (Point of Presence), where
they are removed from the telephone system and injected into the ISP's regional
network.

From this point on, the system is fully digital and packet switched.

* The ISP's regional network consists of interconnected routers in the various cities the
ISP servers.

Architecture of the Internet:

* If the packet is destined for a host served directly by the ISP, the packet is delivered to
the host. Otherwise, it is handed over to the ISP's backbone operator through which
the packets are delivered.

* NAP (Network access points) was used to connect all the regional backbone
operators.

* In 1982, the Internet protocol suite (TCP/IP) was introduced as the standard
networking protocol on the ARPANET.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 16


ATM

* ATM (asynchronous transfer mode) technology that is fundamentally a packet-


switching technology. It is basically a digital virtual circuit for moving fixed-sized
packets (cells) at 155 Mbps.

* The actual service offered is


connection oriented, but it is
implemented internally with
packet switching.

* In ATM, all packets are of fixed length of 53 bytes in which 48 bytes are used for user
data and 5 bytes for header which consist the information to forward each cell to the
proper destination.

ATM Virtual Circuit

* ATM uses a connection-oriented model in which a virtual circuit must be established


between two endpoints before the actual data exchange begins. The ATM standard
defined two types of ATM connections:

* Virtual circuits can be statically configured as permanent virtual circuits (PVCs) or


dynamically controlled via signaling as switched virtual circuits (SVCs).

i). Permanent virtual circuits

* The PVC creates a permanent virtual circuit that exists till the connection is
terminated. The corresponding table entry is recorded by the system administrator. An
outgoing VCI (virtual connection identifier) is given to the source and the incoming
VCI is given to the destination.

ii). Switched virtual circuits

* The SVC creates a temporary short connection that exists only when the data being
transferred between source and destination. SVC requires a connection phase, which
includes two steps, setup request and the acknowledgement.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 17


The ATM Reference Model

* The ATM model consists of three layers, the physical, ATM, and ATM adaptation
layers, plus whatever users want to put on top of that.

* The ATM Reference Model consists of 3 planes: User & control, Layer and Plane
management.

* A User plane is for transporting user information.

* A control plane is responsible for establishing, maintaining and clearing down user
connections in the user plane. It contains mainly signaling information.
* Layer management monitors and coordinates the individual layer tasks.
* Plane management handles monitoring and coordination tasks in the network.

The ATM layers and sub-layers and their functions

i). The physical layer:

* Deals with the physical medium: voltages, bit timing, and various other issues.

* ATM has been designed to be independent of the transmission medium.

ii). The ATM layer:

* Deals with cells and cell transport. It defines the layout of a cell and tells what the
header fields mean.

* It also deals with the establishment and release of virtual circuits and congestion
control.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 18


iii). The ATM Adaptation Layer (AAL):

* The ATM Adaptation layer has been defined to allow users to send packets larger
than a cell.

* The ATM interface segments these packets, transmit the cells individually, and
reassembles them at the other end. This layer is the AAL (ATM Adaptation Layer).

* The AAL layer is split into a SAR (Segmentation And Reassembly) sublayer and a
CS (Convergence Sublayer).

* The lower SAR sublayer breaks up the packets into cells on the transmit side and puts
them back together again at the destination.

* The upper CS sublayer makes it possible to have ATM systems offer different kinds
of services to different applications (e.g., file transfer and video on demand have
different requirements concerning error handling, timing, etc.).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 19


QoS in ATM.

ATM Service Categories / Flow Classes.

* An application wishing to send data across an ATM network should advise the
network of the type of data is to be sent, together with any Quality of Service (QoS)
requirements.

* The ATM Forum defined four service classes: CBR, VBR, ABR, and UBR (or five
service categories) in order to try and match traffic characteristics and QoS
requirements to network behavior, which are described below.

i). CBR

* The constant-bit-rate (CBR) class is designed for customers who need real time audio
or video services. The service is similar to a dedicated line such as a T line.

ii). VBR

* The variable-bit-rate (VBR) class is divided into two subclasses: real-time (VBR-RT)
and non-real-time (VBR-NRT).

a). VBR-RT is designed for those users who need real-time services (such as voice and
video transmission) and use compression techniques to create a variable bit rate.

b). VBR-NRT is designed for those users who do not need real-time services, but use
compression techniques to create a variable bit rate.

iii). ABR

* The available-bit-rate (ABR) class delivers cells at a minimum rate. If more network
capacity is available, this minimum rate can be exceeded. ABR is particularly suitable
for applications that are bursty.

iv). UBR

* The unspecified-bit-rate (UBR) class is a best-effort delivery service that does not
guarantee anything. The above figure shows the relationship of different classes to the
total capacity of the network.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 20


2. THE PHYSICAL LAYER

The purpose of the physical layer is to transport a raw bit stream from one machine to
another. Various physical media can be used for the actual transmission. Each one has its
own benefits in terms of bandwidth, delay, cost, and ease of installation and maintenance.

Transmission media:

* Transmission media is a physical path between transmitter and receiver in a data


transmission system. It is classified into guided media, such as copper wire and
fiber optics, and unguided media, such as radio and lasers through the air.

i). Guided media: Transmission capacity depends critically on the medium, the length, and
whether the medium is point-to-point or multipoint (e.g. LAN).
Examples are coaxial cable, twisted pair, and optical fiber.

ii). Unguided media: provides a means for transmitting electro-magnetic signals, but do not
guide them. Ex: wireless transmission.

Guided media:

a). Twisted pair.

* A twisted pair consists of two insulated copper wires. One wire carries the signal and
the other is used for ground reference. The receiver uses the difference between the
two levels.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 21


* The significance of twisting is it, reduces or nullifies the Interference (noise or cross
talk) caused due to RF or EMI. By twisting the wires, effect of external noise or any
disturbance is same on both the wires. Since the receiver takes only the difference
between the two wires the effective noise is cancelled.

Twisted pair cables are available as STP (shielded twisted pair) and UTP (unshielded twisted
pair).

i). Shielded Twisted Pair (STP):

STP is similar to UTP but with each pair covered


by an additional copper braid jacket or foil
wrapping. This shielding helps protect the signals
on the cables from external interference. STP
spectral bandwidth is in the range of 20 to 300
MHz should be limited to a total distance of 90
meters (295 feet)

ii). Unshielded twisted pair (UTP):

There are various categories in twisted pair


cables. The higher category number has more
number of twists per centimeter, which results
in less crosstalk and a better quality signal over
longer distances, making them more suitable
for high speed computer communication.

Categories of Unshielded Twisted Pair:

CAT1 is typically used for telephone wire. This type of wire is not capable of supporting
computer network traffic and is not twisted. CAT1 is also used by Telco companies providing
ISDN and PSTN services. CAT2, CAT3, CAT4, CAT5/5e, CAT6 & CAT 7 support,
computer network and telephone traffic.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 22


b). Coaxial.

* A coaxial cable consists of a stiff copper wire as the core (center core), surrounded by
an insulating material (dielectric insulator).

* The insulator is encased by a closely woven braided mesh cylindrical conductor. The
outer conductor is covered in a protective plastic sheath (plastic jacket).

* Coaxial cables are categorized by their radio government (RG) ratings. Each RG
number denotes a unique set of physical properties.

* 50-ohm cable is commonly used for digital transmission. The other kind, 75-ohm
cable, is commonly used for analog transmission and cable television.

Two kinds of coaxial cable are widely used.

i). Thin Coaxial (RG 58):

* Thin Coaxial cable is also referred to as thinnet. 10Base2 refers to the specifications
for thin coaxial cable carrying Ethernet signals. The 2 refers to the approximate
maximum segment length being 200 meters. In actual fact the maximum segment
length is 185 meters.

ii). Thick Coaxial (RG 11):

* Thick Coaxial cable is also referred to as thicknet. It has an extra protective plastic
cover that helps keep moisture away from the center conductor. 10Base5 refers to the
specifications for thick coaxial cable carrying Ethernet signals. The 5 refers to the
maximum segment length being 500 meters.

* One disadvantage of thick coaxial is that it does not bend easily and is difficult to
install. But it is highly resistant to signal interference and support greater cable
lengths between network devices than twisted pair cable.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 23


c). Fiber optic:

* Fiber optic cabling consists of a center glass core surrounded by several layers of
protective materials. It transmits light rather than electronic signals, eliminating the
problem of electrical interference. So it can transmit signals over much longer
distances than coaxial and twisted pair.

* 10BaseF refers to the specifications for fiber optic cable carrying Ethernet signals.

* Multi-mode optical fiber is less expensive than single-mode optical fiber. It’s typical
transmission speed and distance limits are 100 Mbit/s for distances up to 2 km
(100BASE-FX), 1 Gbit/s up to 1000 m, and 10 Gbit/s up to 550 m.

* Single mode optical fiber supports 10 Gbit/s up to 10 Km.

Fiber optic cables:

* Fiber optic cables are similar to coax, except without the braid. At the center is the
glass core through which the light propagates.

* In Multimode fibers, the core is typically 50 microns in diameter, about the thickness
of a human hair. In single mode fibers, the core is 8 to 10 microns.

Single mode fiber Multimode fiber

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 24


Light Source:

* Two kinds of light sources are typically used to do the signaling, LEDs (Light
Emitting Diodes) and semiconductor lasers.

Light propagation methods:

i). Single mode fiber:

* Single mode fiber optic cable has a small diameter core that allows only one mode of
light to propagate. Because of this, the number of light reflections created as the light
passes through the core decreases, lowering attenuation and creating the ability for the
signal to travel further. In single-mode fibers the typical maximum length of a cable
without repeater is 20 KM.

ii). Multimode fiber:

* Multimode optic cable has a large diameter core that allows multiple modes of light to
propagate. Due to this, the number of light reflections created as the light passes
through the core increases, creating the ability for more data to pass through at a given
time. Data and audio/video applications in LANs.

* Because of the high dispersion and attenuation rate, the quality of the signal is
reduced over long distances. The typical maximum length of a cable without repeater
is 2 KM. So it is used for short distance applications Ex: data and audio/video
applications in LANs.

a). Step index multimode fiber:

* In this type of fiber the core density remains same. So the light travels in straight line
towards the interface. But when it reaches the core and the cladding interface, the
density (refractive index) is lower and the light abruptly changes its motion causing
distortion to the signal as it passes through the fiber.

* The term step index refers to the suddenness of this change.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 25


b). Graded index multimode fiber:

* In this type of fiber the core refractive index diminishes gradually from the center axis
out toward the cladding. The higher refractive index at the center makes the light rays
moving down the axis more slowly than those near the cladding.

* Due to the graded index, light in the core curves helically rather than zigzag off the
cladding, reducing its travel distance.

Fig. Step index and Graded index multi modes:

* The shortened path and the higher speed allow light to arrive at a receiver at about the
same time in straight rays at the core axis. The result: digital pulse suffers less
dispersion. This type of fiber is best suited for local-area networks.

Comparison / Differences between Copper wire and Fiber optic:

i). Copper cable Advantages:

* Copper cables are laid and in use since decades. So they can be used as it is without
any futher investment.
* Copper cables for example cat 5e supports up to 1Gbps speed.
* Copper cables are inexpensive compared to fiber optic cables.

ii). Fiber optic Advantages:

* Fiber optic cables are much more superior than copper cable in many terms.

* Long Distances: The signal loss (attenuation) in fiber optic cable is very less
compared to copper cable. So fiber optic cable supports faster transmission speeds
and larger bandwidth than copper cables, particularly in longer distances.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 26


* EMI effect: Fiber optic cables are uneffected due to electromagnetic interference.
Copper wires, will produce electromagnetic currents that can interfere with other
wires.

* Strength: Fiber optic cables are more rigid and have long life span than copper
cables.

* The disadvantage of fiber cable is it needs lots of investment to replace the existing
copper cable, particulary backbone cable and other network infrastructure.

Electro Magnetic spectrum:

* The electromagnetic spectrum is a continuum of all electromagnetic waves arranged


according to frequency and wavelength. Electromagnetic energy passes through space
at the speed of light in the form of sinusoidal waves. The wavelength is the distance
from wavecrest to wavecrest.

* The radio, microwave, infrared, and visible light portions of the spectrum can all be
used for transmitting information by modulating the amplitude, frequency, or phase of
the waves except Ultraviolet light, X-rays, and gamma rays which are dangerous to
living things.

* The official ITU names of the bands based on the wavelengths, the LF low frequency
band go from 1 km to 10 km (approximately 30 kHz to 300 kHz).

* Medium Frequency 300Khz to 3000Khz, and High Frequency refer 3 to 30 Mhz and
so on. The higher bands were later named the Very, Ultra, Super, Extremely High
Frequency bands.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 27


Unguided media (wireless):

* For wireless communication the electromagnetic spectrum of radio, microwave,


infrared, and visible light portions of the spectrum is used for transmitting information
by modulating the amplitude, frequency, or phase of the waves.

i). Radio Waves:

* Radio waves are easy to generate, can travel long distances, and can penetrate
buildings easily, so they are widely used for communication, both indoors and
outdoors. Radio waves are omni-directional (in all directions) from the source.

* The properties of radio waves are frequency dependent. At low frequencies, radio
waves pass through obstacles well, but the power falls off sharply with distance from
the source, roughly as 1/r2 in air.

* At high frequencies, radio waves tend to travel in straight lines and bounce off
obstacles. They are also absorbed by rain.

ii). Microwave:

* Above 100 MHz, the waves travel in nearly straight lines and can therefore be
narrowly focused. Concentrating all the energy into a small beam by means of a
parabolic antenna gives a much higher signal-to-noise ratio, but the transmitting and
receiving antennas must be accurately aligned with each other.

Advantages:

* This directionality allows nearby microwave equipment to use the same frequencies
with multiple transmitters lined up in a row to communicate with multiple receivers in
a row without interference.

Disadvantages:

* Unlike radio waves at lower frequencies, microwaves do not pass through buildings
well. In addition, there is still some divergence in space. Some waves may be
refracted off and may take slightly longer to arrive than the direct waves. The delayed
waves may arrive out of phase with the direct wave and thus cancel the signal. This
effect is called multipath fading and is often a serious problem.

* It is weather and frequency dependent. Affected greatly by environmental constraints,


including rain fade. Some operators keep 10 percent of their channels idle as spares to
switch on when multipath fading wipes out some frequency band temporarily.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 28


iii). Infrared Waves:

* Unguided infrared waves are used for short-range communication. Ex: TV, AC
remote controls. They are relatively directional, cheap, and easy to build.

Advantages:

* Infrared system in one room of a building will not interfere with a similar system in
adjacent rooms or buildings. Also security of infrared systems against eavesdropping
is better than that of radio systems. No government license is needed to operate an
infrared system.

Disadvantages: Infrared waves do not pass through solid walls.

iv). Lightwave Transmission:

* Using lightwave transmission we can connect the LANs in two buildings via lasers
mounted on their rooftops. Coherent (same freq, phase) optical signaling using lasers
is inherently unidirectional, so each building needs its own laser and its own
photodetector.

Advantage:

* This scheme offers very high bandwidth and very low cost. It is also relatively easy to
install and, unlike microwave, does not require any license.

Disadvantage:

* A disadvantage is that laser beams cannot penetrate rain or thick fog, but they
normally work well on sunny days.

* Even heat from the sun during the daytime caused convection currents to rise up from
the roof of the building causes turbulent air diverted the beam and made it dance
around the detector. Atmospheric ''seeing'' like this makes the stars twinkle.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 29


Communication Satellites:

* A communication satellite can be thought of as a big microwave repeater in the sky. It


amplifies the incoming signal, and then rebroadcasts it on another frequency to avoid
interference with the incoming signal.

* The downward beams can be broad, covering a substantial fraction of the earth's
surface, or narrow, covering an area only hundreds of kilometers in diameter. This
mode of operation is known as a bent pipe.

* Satellites are normally placed in three regions avoiding Van Allen belts layers
which contain highly charged particles which may destroy the satellite.

The principle bands for Satellite communication.

i). GEO or Geo stationary Earth Orbit

* These satellites are in orbit 35,786 km above the earth’s surface along the equator.

* Objects in Geostationary orbit revolve around the earth at the same speed as the earth
rotates and remain in the same position relative to the surface of earth.

Advantages:

* A GEO satellite’s distance from earth gives it a large coverage area (foot print),
almost a fourth of the earth’s surface.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 30


* GEO satellites have a 24 hour view of a particular area and make it ideal for satellite
broadcast and other multipoint applications.

Disadvantages:

* A GEO satellite’s distance also cause it to have both a comparatively weak signal and
a time delay in the signal, which is bad for point to point communication.

* GEO satellites, centered above the equator, have difficulty broadcasting signals to
near polar regions.

ii). MEO or Medium Earth Orbit

* A MEO satellite is in orbit somewhere between 8,000 km and 18,000 km above the
earth’s surface.

* MEO satellites are visible for much longer periods of time than LEO satellites,
usually between 2 to 8 hours. MEO satellites have a larger coverage area than LEO
satellites.

Advantage:

* A MEO satellite’s longer duration of visibility and wider footprint means fewer
satellites are needed in a MEO network than a LEO network.

Disadvantage:

* A MEO satellite’s distance gives it a longer time delay and a weaker signal than a
LEO satellite, though not as bad as a GEO satellite.

Global Positioning System.

* One example of a MEO satellite system is the Global Positioning System (GPS).
Positioned at an altitude of 18,000 km (11,000 mi) above the Earth.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 31


* GPS is used for land, sea, and air navigation to provide time and locations for vehicles
and ships.

* GPS uses 24 satellites in six orbits, as shown in the below figure. The orbits and the
locations of the satellites in each orbit are designed in such a way that, at any time,
four satellites are visible from any point on Earth.

iii). LEO or Low Earth Orbit:

* Low-Earth-orbit (LEO) satellites have polar orbits. LEO satellites are much closer to
the earth than GEO satellites, ranging from 500 to 1,500 km above the surface.

* LEO satellites don’t stay in fixed position relative to the surface, and are only visible
for 15 to 20 minutes each pass. A network of LEO satellites is necessary for LEO
satellites to be useful.

Advantages:

* A LEO satellite’s proximity to earth compared to a GEO satellite gives it a better


signal strength and less of a time delay, which makes it better for point to point
communication.

* A LEO satellite’s smaller area of coverage is less of a waste of bandwidth.

Disadvantages:

* A network of LEO satellites is needed, which can be costly

* LEO satellites have to compensate for Doppler shifts cause by their relative
movement.

* Atmospheric drag effects LEO satellites, causing gradual orbital deterioration.

Iridium System

* The concept of the Iridium system was started with a 77-satellite network, but later
reduced to 66 satellites. The original name, Iridium, came from the name of the 77th
chemical element; a more appropriate name is Dysprosium (the name of element 66).

* The system has 66 satellites divided into six orbits, with 11 satellites in each orbit.

* The orbits are at an altitude of 750 km. The satellites in each orbit are separated from
one another by approximately 32° of latitude. The figure shows a schematic
diagram of the constellation.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 32


* The number of active spot beams at any moment is approximately 2000. Each spot
beam covers a cell on Earth, which means that Earth is divided into approximately
2000 (overlapping) cells.

* In the Iridium system, communication between two users takes place through
satellites. When a user calls another user, the call can go through several satellites
before reaching the destination.

* This means that relaying is done in space and each satellite needs to be sophisticated
enough to do relaying. This strategy eliminates the need for many terrestrial stations.

Globalstar

* Globalstar is another LEO satellite system.

* The system uses 48 satellites in six polar orbits with each orbit hosting eight satellites.
The orbits are located at an altitude of almost 1400 Km.

* The Globalstar system is similar to the Iridium system; the main difference is the
relaying mechanism.

* Communication between two distant users in the Iridium system requires relaying
between several satellites;

* Globalstar communication requires both satellites and Earth stations, which means
that ground stations can create more powerful signals.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 33


THE PUBLIC SWITCHED TELEPHONE NETWORK

* Telephone networks use circuit switching. Earlier telephone networks which are
referred as the plain old telephone system (POTS), was originally an analog system
using analog signals to transmit voice.

* With the advent of the computer era, the network, in the 1980s, began to carry data in
addition to voice. During the last decade, the telephone network has undergone many
technical changes. The network is now digital as well as analog.

Major Components:

* The telephone network, is made of three major components: local loops, trunks, and
switching offices. The telephone network has several levels of switching offices such
as end offices, tandem offices, and regional offices.

Local Loops: One component of the telephone network is the local loop, a twisted-pair cable
that connects the subscriber telephone to the nearest end office or local central office. The
local loop, when used for voice, has a bandwidth of 4000 Hz (4 kHz).

End office: Each telephone has two copper wires coming out of it that go directly to the
telephone company's nearest end office (also called a local central office).

Trunks: Trunks are transmission media that handle the communication between offices. A
trunk normally handles hundreds or thousands of connections through multiplexing.
Transmission is usually through optical fibers or satellite links.

Switching Offices: To avoid having a permanent physical link between any two subscribers,
the telephone company has switches located in a switching office. A switch connects several
local loops or trunks and allows a connection between different subscribers.

Toll office: Each end office has a number of outgoing lines to one or more nearby switching
centers, called toll offices (or if they are within the same local area, tandem offices). These
lines are called toll connecting trunks.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 34


1. Multiplexing

Multiplexing is a technique that allows the simultaneous transmission of multiple signals


across a single data link. There are three basic multiplexing techniques:

i). Frequency-division multiplexing,


ii). Wavelength-division multiplexing,
iii). Time-division multiplexing.

The first two are techniques designed for analog signals, the third, for digital signals

i). Frequency-division multiplexing

Frequency-division multiplexing (FDM) is an analog technique. In FDM, signals generated


by each sending device modulate different carrier frequencies. Below figure shows how three
voice-grade telephone channels are multiplexed using FDM.

Filters limit the usable bandwidth to about 3100 Hz per voice-grade channel. When many
channels are multiplexed together, 4000 Hz is allocated to each channel to keep them well
separated.

First the voice channels are raised in frequency, each by a different amount. Then they can be
combined because no two channels now occupy the same portion of the spectrum.

The Analog Carrier System

To maximize the efficiency of their infrastructure, telephone companies have traditionally


multiplexed signals from lower-bandwidth lines onto higher-bandwidth lines.

In this way, many switched or leased lines can be combined into fewer but bigger channels.
For analog lines, FDM is used. One of these hierarchical systems used by AT&T is made up
of groups, super groups, master groups, and jumbo groups

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 35


In this analog hierarchy, 12 voice channels are multiplexed onto a higher-bandwidth line to
create a group.

A group has 48 kHz of bandwidth and supports 12 voice channels. At the next level, up to
five groups can be multiplexed to create a composite signal called a supergroup. A
supergroup has a bandwidth of 240 kHz and supports up to 60 voice channels. Supergroups
can be made up of either five groups or 60 independent voice channels.

At the next level, 10 supergroups are multiplexed to create a master group. A master group
must have 2.40 MHz of bandwidth, but the need for guard bands between the supergroups
increases the necessary bandwidth to 2.52 MHz. Master groups support up to 600 voice
channels.

Finally, six master groups can be combined into a jumbo group. A jumbo group must have
15.12 MHz (6 x 2.52 MHz) but is augmented to 16.984 MHz to allow for guard bands
between the master groups.

Applications of FDM:

1. AM Radio: A special band from 530 to 1700 kHz is assigned to AM radio. All radio
stations need to share this band. Each AM station needs 10kHz of bandwidth. Each station
uses a different carrier frequency, which means it is shifting its signal and multiplexing.

2. FM Radio: FM broadcasting has a wider band of 88 to 108 MHz because each station
needs a bandwidth of 200 kHz.

3. TV Channel: In television broadcasting. Each TV channel has its own bandwidth of 6


MHz.

4. The first generation of cellular telephones (Advanced Mobile Phone System -AMPS) uses
FDM. Each user is assigned two 30-kHz channels, one for sending voice and the other for
receiving. The voice signal, which has a bandwidth of 3 kHz (from 300 to 3300 Hz), is
modulated by using FM.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 36


Digital Signal Service (Digital Hierarchy): T1 lines

Telephone companies implement TDM through a hierarchy of digital signals, called digital
signal (DS) service or digital hierarchy. Below figure shows the data rates supported by each
level.

DS and T line rates:

A DS-O service is a single digital channel of 64 kbps. DS-O, DS-l, and so on are the names
of services. To implement those services, the telephone companies use T lines (T-l to T-4).
These are lines with capacities precisely matched to the data rates of the DS-l to DS-4
services.

E Lines

Europeans use a version of T lines called E lines. The two systems are conceptually identical,
but their capacities differ. Below table shows the E lines and their capacities.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 37


ii). Wavelength-Division Multiplexing

Wavelength-division multiplexing (WDM) is an analog multiplexing technique to combine


optical signals. WDM is designed to use with fiber-optic cable.

WDM is conceptually the same as FDM, except that the multiplexing and demultiplexing
involve optical signals transmitted through fiber-optic channels. Different signals of different
frequencies are combined. The difference is that the frequencies are very high.

Conceptual view of a WDM multiplexer and demultiplexer. Very narrow bands of light from
different sources are combined to make a wider band of light. At the receiver, the signals are
separated by the demultiplexer.

One application of WDM is the SONET (Synchronous Optical Network) network in which
multiple optical fiber lines are multiplexed and demultiplexed.

DWDM (Dense Wavelength Division Multiplexing):

Dense WDM (DWDM), can multiplex a very large number of channels by spacing channels
very close to one another. It achieves even greater efficiency.

Current systems offer from 4 to 32 channels of wavelengths. The higher numbers of


wavelengths has lead to the name Dense Wavelength Division Multiplexing or DWDM.

The technical requirement is only that the lasers be of very specific wavelengths and the
wavelengths are very stable.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 38


iii). Time-Division Multiplexing.

Time-division multiplexing (TDM) is a digital multiplexing method in which two or more bit
streams or signals are transferred apparently simultaneously as sub-channels in one
communication channel.

* The time domain is divided into several recurrent time slots of fixed length, one for
each sub-channel.

* A data block of sub-channel 1 is transmitted during time slot 1, sub-channel 2 during


time slot 2, sub-channel 3 during time slot 3 and so on...

Time division multiplexing comes in two basic forms:

a). Synchronous time division multiplexing, and


b). Statistical, or asynchronous time division multiplexing.

a). Synchronous time division multiplexing:

* In synchronous TDM, time slots are grouped into frames.

* A frame consists of one complete cycle of time slots, with one slot dedicated to each
sending device.

* In a system with n input lines, each frame has n slots, with each slot allocated to
carrying data from a specific input line.

* If the duration of the input unit is T, the duration of each slot is T/n and the duration of
each frame is T.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 39


Empty Slots:

* In Synchronous TDM, for every input unit one output slot in the frame is allocated.
This is not so efficient because if a source does not have data to send, the
corresponding slot in the output frame is empty.

The figure illustrates this. One of the input lines has no data to send and one slot in
another input line has discontinuous data.

b). Statistical Time-Division Multiplexing

* In synchronous TDM, each input has a reserved slot in the output frame. This can be
inefficient if some input lines have no data to send.

* In statistical time-division multiplexing, slots are dynamically allocated to improve


bandwidth efficiency. Only when an input line has a slot's worth of data to send it is
given a slot in the output frame.

* In statistical multiplexing, the number of slots in each frame is less than the number of
input lines. The multiplexer checks each input line in round robin fashion; it allocates
a slot for an input line if the line has data to send; otherwise, it skips the line and
checks the next line.

* In StatTDM, no slot is left empty as long as there are data to be sent by any input line.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 40


2. Switching:

* Switching is a technique used to connect the communicating devices point to point in


a multi device environment or network. Three types of switching methods are
normally used:

i). Circuit switching:

* Circuit switching is connected by physical links. Each connection requires a dedicated


channel (path). Normally a single link is divided into n channels by using FDM or
TDM.

* In circuit switching, the resources need to be reserved during the setup phase; the
resources remain dedicated for the entire duration of data transfer until the teardown
phase.

There are three phases in circuit switching.

a). In the first phase known as setup phase the dedicated path between the two
communication devices is established.

b). In the second phase the data transfer takes place.

c). In the third phase the line is terminated after the data transmission is completed.

* Connection-oriented packet switching, also known as virtual circuit switching used in


X.25, frame relay, ATM and TCP.

Drawbacks: Efficiency is poor in circuit switching networks because the resources are
dedicated irrespective of data flow is present or not.

ii). Message switching

* In this form of switching no physical path is established in advance. There is no limit


on the message size (block size).

* Each message contains addressing information and at each switch this information is
read and decides the transfer path to the next switch. Each message is stored before
being transmitted to the next switch.

* Because of this it is also known as a “store-and-forward” network. No dedicated path


is used, depending on network conditions, messages may transfer over different paths.

Ex: Email is a common application for Message Switching.

Drawbacks: There is no limit on message size, so at every hop the routers should store them
in hard disk drive rather than memory this makes the process slow.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 41


iii). Packet Switching

* Packet switching is a digital networking, communications method where data is


transmitted into suitably sized blocks, called packets.

* In packet switching, there is no resource allocation for a packet. Resources are


allocated only on demand. The allocation is done on a first-come, first-served basis.
When a packet receives a switch, it must wait until other packets being processed.

* Packet switching features delivery of variable-bit-rate data streams (sequences of


packets) over a shared network.

Datagram Networks:

* In a datagram network, each packet is treated independently of all others. Even if a


packet is part of a multipacket transmission, the network treats it as though it existed
alone. Packets in this approach are referred to as datagrams.

* Datagram switching is also known as Connection less packet switching used in


Ethernet, IP and UDP.

Comparison between Circuit switching and Packet switching:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 42


3. SONET / SDH

* Synchronous Optical Networking (SONET) and Synchronous Digital Hierarchy


(SDH) are standardized multiplexing protocols that transfer multiple digital bit
streams over optical fiber using lasers or light-emitting diodes (LEDs).

* The method was developed to replace the Plesiochronous (almost synchronous)


Digital Hierarchy (PDH) system for transporting larger amounts of telephone calls
and data traffic over the same fiber without synchronization problems.

* SONET (published by ANSI) and SDH (published by ITU), which are essentially the
same, were originally designed to transport circuit mode communications (e.g., DS1,
DS3) from a variety of different sources and to support real-time, uncompressed,
circuit-switched voice encoded in PCM format.

* The primary difficulty in doing this prior to SONET/SDH was that the
synchronization sources of these various circuits were different. This meant that each
circuit was actually operating at a slightly different rate and with different phase.

Table. SDH (Synchronous Digital Hierarchy)

(STM: Synchronous Transfer Module)

Table. SONET (Synchronous Optical Network)

(STS: Synchronous Transfer Signal)

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 43


THE MOBILE TELEPHONE NETWORK

IMTS (Improved Mobile Telephone System)

* IMTS used a high-powered (200-watt) transmitter, on top of a hill, with two


frequencies, one for sending and one for receiving, avoiding the push-to-talk button.

* IMTS supported 23 channels spread out from 150 MHz to 450 MHz. Due to the small
number of channels, users often had to wait a long time before getting a dial tone.
Also, due to the large power of the hilltop transmitter, adjacent systems had to be
several hundred kilometers apart to avoid interference. All in all, the limited capacity
made the system impractical.

Advanced Mobile Phone System (AMPS): (1st generation, Analog)

* In mobile phone systems, a geographic region is divided up into cells, which is why
the devices are sometimes called cell phones. In AMPS, the cells are typically 10 to
20 km across. Each cell uses some set of frequencies not used by any of its neighbors.

* The key idea that gives cellular systems far more capacity than previous systems is
the use of relatively small cells and the reuse of transmission frequencies in nearby
(but not adjacent) cells.

* Whereas an IMTS system 100 km across can have one call on each frequency, an
AMPS system might have 100 10-km cells in the same area and be able to have 10 to
15 calls on each frequency, in widely separated cells.

* Thus, the cellular design increases the system capacity. Furthermore, smaller cells
mean that less power is needed, which leads to smaller and cheaper transmitters and
handsets. Handheld telephones put out 0.6 watts; transmitters in cars are 3 watts etc.

Frequency-Reuse Principle

* The set of frequencies available is limited, and frequencies need to be reused.


Neighboring cells cannot use the same set of frequencies for communication
because it may create interference for the users located near the cell boundaries.

* A frequency reuse pattern is


a configuration of N cells, N
being the reuse factor, in
which each cell uses a
unique set of frequencies.

* When the pattern is


repeated, the frequencies
can be reused as shown in
the figure.

* The numbers in the cells define the pattern. The cells with the same number in a
pattern can use the same set of frequencies. We call these cells the reusing cells. For

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 44


example With reuse factor 4, only one cell separates the cells with reuse factor 7, two
cells separate the reusing cells.

The elements that determine frequency reuse are the reuse distance and the reuse
factor. The reuse distance, D is calculated as

D=R

Where R is the cell radius and N is the number of cells per cluster. The cells may vary
in radius from 1 to 30 kilometres. The boundaries of the cells can also overlap
between adjacent cells and large cells can be divided into smaller cells

D-AMPS: The Digital Advanced Mobile Phone System: (2nd generation. digital)

* The second generation of the AMPS systems is D-AMPS and is fully digital. It is
described in International Standard IS-54 and its successor IS-136. On a D-AMPS
mobile phone, the voice signal picked up by the microphone is digitized and
compressed.

* In D-AMPS, three users can share a single frequency pair using time division
multiplexing. Each frequency pair supports 25 frames/sec of 40 msec each.
Each frame is divided into six time slots of 6.67 msec each, as illustrated in fig (a) for
the lowest frequency pair.

* Each frame holds three users who take turns using the upstream and downstream
links. During slot 1, for example, user 1 may transmit to the base station and user 3 is
receiving from the base station.

* Each slot is 324 bits long, of which 64 bits are used for guard times, synchronization,
and control purposes, leaving 260 bits for the user payload. Of the payload bits, 101
are used for error correction over the noisy air link, so ultimately only 159 bits are left
for compressed speech.

* With 50 slots/sec, the bandwidth available for compressed speech is just under 8 kbps,
1/7 of the standard PCM bandwidth. Using better compression algorithms, it is
possible to get the speech down to 4 kbps, in which case six users can be stuffed into
a frame, as illustrated in Fig (b).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 45


GSM:

* The Global System for Mobile communications (GSM) was developed by the
Groupe Speciale Mobile (GSM) which was founded in Europe in 1982. The GSM is a
standard for mobile telecommunication through a cellular network at data transfer
rates of up to 14.4 kbps. GSM is a triple band supports 900MHz, 1800 MHz and 1900
MHz.

* GSM uses FDMA for channels and TDMA for user access in each deployed channel.
Analog signals of up to eight radio-carriers are transmitted when using one common
digital channel of bandwidth 200 kHz.

Fig. GSM FDMA-TDMA

* GSM 900 operates at 890-915 MHz for uplink and 935-960 MHz for downlink.
Uplink and downlink frequency bands of 25 MHz each provide FDMA access for
each channel.

* Each link thus provides 124 (125 including guard band) channels, each of 200 kHz.
Each channel provides 8 TDMA access slots, thus providing channel access to each
user (radio carrier) every 4.615 μs. Eight users have time-slices of 577 μs each.

GSM Architecture:

* The GSM architecture consists of three major interconnected subsystems that interact
with themselves and with users through the certain network interface. The subsystems
are Base Station Subsystem (BSS), Network Switching Subsystem (NSS) and
Operational Support Subsystem (OSS). Mobile Station (MS) is also a subsystem, but
it is considered as a part of BSS.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 46


Fig: GSM Architecture.

Mobile Station (MS): Mobile Station is made up of two entities.

i). Mobile equipment (ME):

* A portable, vehicle mounted, handheld device with a uniquely identified by an IMEI


number. It is used for voice and data transmission. It also monitors power and signal
quality of surrounding cells for optimum handover. 160 characters long SMS can also
be sent using Mobile Equipment.

ii). Subscriber Identity module (SIM):

* It is a smart card that contains the International Mobile Subscriber Identity (IMSI)
number. It allows users to send and receive calls and receive other subscriber services.
Protected by a password or PIN. It contains encoded network identification details
and key information to activate the phone. It can be moved from one mobile to
another.

1. Base Station Subsystem (BSS):

* BSS is also known as radio subsystem, provides and manages radio transmission
paths between the mobile station and the Mobile Switching Centre (MSC). BSS also
manages the interface between the mobile station and all other subsystems of GSM. It
consists of two parts.

i). Base Transceiver Station (BTS): Encodes, encrypts, multiplexes, modulates and feeds
the RF signal to the antenna. It consists of transceiver units which communicates with mobile
stations via radio air interface and also communicates with BSC via Abis interface.

ii). Base Station Controller (BSC): BSC manages radio resources for BTS. It assigns
frequency and time slots for all mobile stations in its area. Handles call setup, transcoding
and adaptation functionality handover for each MS radio power control. It communicates
with MSC via A interface and also with BTS.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 47


2. Network Switching Subsystem (NSS):

* NSS manages the switching functions of the system and allows MSCs to
communicate with other networks such as PSTN and ISDN. It consist of

i). Mobile switching Centre: MSC manages communication between GSM and other
networks. It manages call set up function, routing and basic switching. Performs mobility
management including registration, location updating and inter BSS and inter MSC call
handoff. It also provides billing information. Gateway MSC or GMSC does gateway function
to connect to other outside networks while its customers roam to other network by using
HLR/VLR.

ii). Home Location Registers (HLR): HLR is a permanent database about mobile subscriber
in a large service area. Its database contains IMSI, IMSISDN, prepaid/post-paid, roaming
restrictions, supplementary services.

iii). Visitor Location Registers (VLR): VLR is a temporary database which updates
whenever new MS enters its area by HLR database. It controls mobiles roaming in its area. It
reduces the number of queries to HLR. Its database contains IMSI, TMSI, IMSISDN, MSRN,
location, area authentication key.

iv). Authentication Centre: AuC provides protection against intruders in the air interface. It
maintains authentication keys and algorithms and provides security triplets (RAND, SRES,
Ki).

v). Equipment Identity Registry (EIR): EIR is a database that is used to track handset using
the IMEI number. It is made up of three sub classes- the white list, the blacklist and the gray
list.

3. Operational Support Subsystem (OSS):

* OSS supports the operation and maintenance of GSM and allows system engineers to
monitor, diagnose and troubleshoot all aspects of GSM system. It supports one or
more Operation, Maintenance Centres (OMC) which are used to monitor the
performance of each MS, Bs, BSC and MSC within a GSM system.

* It main functions are to maintain all telecommunication hardware and network


operations with a particular market. To manage all charging and billing procedures
and to manage all mobile equipment in the system.

Handoff:

* During a conversation, if the mobile station moves from one cell to another, then the
signal may become weak. For this the MSC monitors the level of the signal every few
seconds. If the strength of the signal diminishes, the MSC seeks a new cell with a
better signal level.

* The MSC then changes the channel carrying the call (hands the signal off from the old
channel to a new one). Two types of Handoff are normally used.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 48


i). Hard Handoff: In a hard handoff, a mobile station only communicates with one base
station. When the MS moves from one cell to another, communication must first be broken
with the previous base station before communication can be established with the new one.
This may create a rough transition.

Ex: GSM

ii). Soft Handoff: New systems use a soft handoff. In this case, a mobile station can
communicate with two base stations at the same time. This means that, during handoff, a
mobile station may continue with the new base station before breaking off from the old one.

Ex: CDMA

Generations:

* First generation (1G) wireless devices communicated only voice signals. The 1G
Services are analog provided with circuit switching.

* Second generation (2G) are digital, devices communicate voice as well as data
signals. 2G devices have data transfer rates of up to 14.4 kbps.

* The 2.5G and 2.5G + are enhancements of the second generation and support packet
switching and data transfer rates of up to 100 kbps.

* The 3G (third generation) mobile devices support voice, data, and multimedia
streams. With data transfer rates up to 2 Mbps or higher for short distances and 384
kbps for long distance transmissions.

* 4G facilitates higher data rates than 3G and support streaming data for video. 4G
enables multimedia newspaper, high resolution mobile TV, IP telephony and data
transfer rates of 100 Mbps.

* 5G will be significantly faster than 4G, allowing for higher productivity across all
capable devices with a theoretical download speed of 10 Gbps. Plus, with greater
bandwidth comes faster download speeds and the ability to run more complex mobile
internet apps expected by 2019.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 49


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 50


3. DATA LINK LAYER

Design Issues

The specific functions of data link layer are:

1. Providing a well-defined service interface to the network layer. (Framing)


2. Dealing with transmission errors. (Error control)
3. Regulating the flow of data. (Flow control)

Services Provided to the Network Layer

* The principal service of data link layer is to transfer data from the network layer on
the source machine to the network layer on the destination machine.

* The data link layer can be designed to offer various services. Three reasonable
possibilities that are commonly provided are

i). Unacknowledged connectionless service

* The source machine sends frames to the destination machine without any
acknowledgement. No logical connection is established. If a frame is lost, no attempt
is made to detect the loss or recover from it in the data link layer.

This is appropriate for real-time traffic, such as voice, most LANs use
unacknowledged connectionless service in the data link layer.

ii). Acknowledged connectionless service

* No logical connections used. Each frame sent is individually acknowledged. If a


frame is lost or not arrived within a specified time interval, it can be sent again.

This service is useful over unreliable channels, such as wireless systems.

iii). Connection-oriented service

* The source and destination machines establish a connection before any data are
transferred. Each frame sent over the connection is numbered, and guarantees that
each frame is received exactly once and that all frames are received in the right order.

Connection-oriented service goes through three steps.

i). Connection establishment,


ii). Data transfer and
iii). Connection release.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 51


Framing:

* The data link layer encapsulates the packets received from the network layer into
frames. Each frame contains a frame header, a payload field for holding the packet,
and a frame trailer, as shown in the below figure.

* The whole message could be packed in one frame, but the problem is even a single-bit
error would require the retransmission of the whole message. When a message is
divided into smaller frames, a single-bit error affects only that small frame.

* The data link layer break the bit stream up into discrete frames and compute the
checksum and sent with each frame.

* When a frame arrives at the destination, the checksum is recomputed. If there is any
difference in the checksum it discards the frame and may request for retransmission.

* Frames can be of fixed or variable size. Some protocols use fixed size frames some
use variable size frames. Both have their own advantages and disadvantages.

a). Fixed-Size Framing:

* In fixed-size, framing, there is no need for defining the boundaries of the frames; the
size itself can be used as a delimiter. An example of this type of framing is the ATM
wide-area network, which uses frames of fixed size called cells.

b). Variable-Size Framing:

* In variable-size, framing, we need a way to define the end of the frame and the
beginning of the next. Used in LAN.

To count on timing to mark the start and end of each frame, various methods are
devised.

1. Character count.
2. Flag bytes with byte stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.

1. Character count:

* In this method a field in the header is used to specify the number of characters in the
frame. When the data link layer at the destination sees the character count, it
knows how many characters follow and hence where the end of the frame is.

* The disadvantage with this method is if the character count number changes fig (b)
the synchronisation fails and the entire message gets effected.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 52


2. Byte stuffing (Character stuffing):

* In this method of synchronization each frame start and end with special bytes called
flag bytes, as both the starting and ending delimiter. Two consecutive flag bytes
indicate the end of one frame and start of the next one.

* The problem with this method is if the flag byte's bit pattern occur in the data field.
Then the receiver may mistake it as a delimiter.

* To solve this problem an ESC character is inserted just before the flag, if the flag
pattern occurs in the data field.

* It does the same process even if ESC byte occurs in the data field.

* The data link layer on the receiving end removes the escape byte before the data is
given to the network layer. This technique is called byte stuffing or character stuffing.

3. Bit stuffing: (Bit-Oriented Protocols)

* In this method each frame begins and ends with a special bit pattern, 01111110 (a flag
byte). Whenever the sender's data link layer encounters five consecutive 1s in the
data, it automatically stuffs a 0 bit into the outgoing bit stream.

* Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a
0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 53


* Example: When the receiver sees five consecutive incoming 1 bits, followed by a 0
bit, it automatically de-stuffs (i.e., deletes) the 0 bit.

* If the user data contain the flag pattern, 01111110, this flag is transmitted as
011111010 but stored in the receiver's memory as 01111110.

4. Physical layer coding violations.

* In this scheme every data bit has a transition in the middle (high-low pair for 1and
low-high pair for bit 0, making it easy for the receiver to locate the bit boundaries.
The combinations high-high and low-low are used for delimiting frames in some
protocols.

* Many data link protocols use a combination of a character count with one of the other
methods for extra safety.

Error Control

The usual way to ensure reliable delivery is to provide the sender with some
acknowledgement.

* If the sender receives a positive acknowledgement, it knows the frame has arrived
safely.

* On the other hand, a negative acknowledgement means that something has gone
wrong, and the frame must be transmitted again.

* When the sender transmits a frame, it starts a timer. If there is no response within
stipulated time it is deemed that the frame or the acknowledgement is lost so the
sender retransmits the frame.

* However, when frames may be transmitted multiple times there is a danger that the
receiver will accept the same frame two or more times and pass it to the network layer
more than once.

* To prevent this, it is necessary to assign sequence numbers to outgoing frames, so that


the receiver can distinguish retransmissions from originals.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 54


Flow Control

* Flow control is essential because communicating systems may not run at the same
speeds.

* This situation occurs when the sender is running on a fast computer and the receiver is
running on a slow machine or vice versa.

Two approaches are commonly used:

a). Feedback-based flow control:

* The receiver sends back information to the sender giving it permission to send more
data.

b). Rate-based flow control:

* The protocol has a built-in mechanism that limits the rate at which senders may
transmit data, without using feedback from the receiver.

Error Detection and Correction:

Error Detection and Correction are implemented either in data link layer or the transport
layer.

Types of errors:

i). Single bit error:

* In single bit error only one bit of the given data is changed from 1 to 0 or vice versa.

Ex: Send data 10010010  10010011 Received data

ii). Burst (multi bit)errors:

* A burst error means that two or more bits of the given data are changed.

Ex: Send data 10010010  10010111 Received data

Detection:

* Redundancy: Redundancy is a technique where a group of extra bits (redundant) are


appended to each data block to find errors in the data transmissions.

* Retransmission: One way of identifying errors is, by sending the same data twice.
The receiver compares both data blocks bit by bit and if there is any discrepancy it
discards both and requests for retransmission.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 55


* If both the data blocks are same it takes the first block and drops the second.

* In redundancy techniques instead of sending the total data stream a small number of
bits are sent as redundant bits with the original data block. Once the receiver
determines the accuracy these redundant bits are discarded.

Four types of redundancy checks are used in data communications:

1. Vertical redundancy check (VRC) also called parity check


2. Longitudinal redundancy check (LRC)
3. Cyclic redundancy check (CRC)
4. Checksum
5. Internet Checksum

i). Vertical redundancy check (VRC):

* VRC is used for asynchronous data communications referred as character parity or


simple parity. Either even parity or odd parity is used.

* A single redundant bit (parity bit) is appended to each character to force the total
number of logic 1s including parity bit to be either an odd number (odd parity) or
even number (even parity).

Ex: ASCII code of C is 1000011, by adding parity bit it is 1000011P where P is a parity bit.

* If odd parity is used the P bit should be 0, so that the total number of logic 1s
(including parity bit) are odd number.

* If even parity is used the P bit should be 1, so that the total number of logic 1s
(including parity bit) are even number.

Advantage: VRC can detect all single bit errors. It can also detect burst errors as long as the
total number of bits changed to even (in case odd parity is used).

Disadvantage: It cannot identify multiple bits failure. If odd number of bits are received in
error the parity checker will not detect.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 56


ii). Longitudinal redundancy check (LRC):

* With LRC each bit position has a parity bit. In other words b0 (bit 0) from each
character is XORed with their respective bits from all the other characters.

* For example instead of sending the 32 bits we organise them in a table made of four
rows and eight columns as shown in the below table.
b0 b1 b2 b3 b4 b5 b6 b7
Ex: 10101010 11011011 01010101 01101101 1 0 1 0 1 0 1 0
1 1 0 1 1 0 1 1
* We then calculate the parity bit for each column and 0 1 0 1 0 1 0 1
create a new row of eight bits which are the parity bits for 0 1 1 0 1 1 0 1
the whole block. 0 1 0 0 1 0 0 1

* The eight parity bits are appended to the original data and send them to the receiver.

Ex: 10101010 11011011 01010101 01101101 01001001 (LRC)


Generally even parity is used with LRC and odd parity is used with VRC.

iii). Cyclic redundancy check (CRC):


* CRC is based on binary division. By dividing the data unit by a predetermined
polynomial (divisor), the remainder is the CRC or CRC remainder.

* This CRC is appended to the original data so that the resulting data unit becomes
exactly divisible by a second predetermined number.

* The extra number of (000) zeros added


to the dividend is one less than the
number of bits in the divisor.

* When a left most bit of the remainder


is zero (0110) we must use 0000 instead
of the original divisor.

* At the destination the incoming data


unit is divided by the same polynomial,
if there is no reminder than the data is
intact if there is a remainder the data is
discarded.

* The receiver divides the arrived data


(original data + CRC) by the same divisor that was used by the source.

* If the remainder is zero the data is intact, if it is non zero remainder than the data is
changed and it is discarded.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 57


Polynomial:

* Polynomial is an algebraic expression in which the exponents of the variable are


always positive (non-negative) integers.

* The degree of a polynomial is the largest exponent of a variable (in case of one
variable) or sum of largest exponents (in case of more variables).

CRC division using polynomials:

* The divisor in a cyclic code is normally called the generator polynomial (Gx) or
simply the generator.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 58


Advantages of Cyclic Codes:

* Cyclic codes have a very good performance in detecting single-bit errors, double
errors, an odd number of errors, and burst errors.

* They can easily be


implemented in
hardware and software.

They are especially fast when


implemented in hardware.

Ex: Given the data word


1010011110 and the divisor
10111.

a). Show the generation of the


codeword at the sender site
(using binary division).

b). Show the checking of the


codeword at the receiver site
(assume no error).

Sender and receiver using polynomial division:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 59


iv). Checksum

* Suppose our data is a list of five 4-bit numbers that we want to send to a destination.
In addition to sending these numbers, we send the sum of the numbers.

* For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0, 6, 36),
where 36 is the sum of the original numbers.

* The receiver adds the five numbers and compares the result with the sum.

* If the two are the same, the receiver assumes no error, accepts the five numbers, and
discards the sum. Otherwise, there is an error somewhere and the data are not
accepted.

Using 1s complement:

* We can send the negative (complement) of the sum, called the checksum. In this case,
we send (7, 11, 12, 0, 6, −36).

* The receiver can add all the numbers received (including the checksum). If the result
is 0, it assumes no error; otherwise, there is an error.

v). Internet Checksum

Traditionally, the Internet has been using a 16-bit checksum. The sender calculates the
checksum by following these steps.
Example:

Sender site:

1. The message is divided into 16-


bit words.
2. The value of the checksum
word is set to 0.
3. All words, including the
checksum are added using one's
complement addition.
4. The sum is complemented and
becomes the checksum.
5. The checksum is sent with the data.

The receiver uses the following steps for error detection.

1. The message (including checksum) is divided into 16-bit words.


2. All words are added using one's complement addition.
3. The sum is complemented and becomes the new checksum.
4. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 60


Error Correction:

There are two main methods of error correction.

1. Retransmission
2. Forward Error Correction

1. Retransmission:

* Retransmission is a technique in which the receiver detects the occurrence of an error and
asks the sender to resend the message. Resending is repeated until a message arrives that
the receiver believes is error-free.

2. Forward Error Correction:

* Forward error correction is the process in which the receiver tries to guess the
message by using redundant bits (error correcting code) which automatically
corrects certain errors.

Elementary Data Link Protocols

Noiseless Channels
i). Unrestricted Simplex Protocol
ii). Stop-and-Wait Protocol

Noisy Channels (sliding window Protocols)

i) Stop-and-Wait Automatic Repeat Request


ii). Go-Back-N Automatic Repeat Request
iii). Selective Repeat Automatic Repeat Request

i). Unrestricted Simplex Protocol


Assumptions:

* Data is transmitted in only one


direction - Simplex).

* Both the transmitting and receiving


network layers are always ready.

* Processing time can be ignored.


Infinite buffer space is available.

* No errors take place on the physical channel and no sequence numbers or


acknowledgements are used here.

* Only the info field of the frame is used by this protocol, since there are no errors or
flow control restrictions here.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 61


ii). A Simplex Stop-and-Wait Protocol:

* Protocols in which the sender sends one frame and then waits for an
acknowledgement before proceeding are called stop-and-wait.

* The data flow is simplex and the


communication channel is still
assumed to be error free.

* The sender sends one frame and


waits for the acknowledgement
from the receiver before sending
next frame.

* It leads to a bandwidth utilization that is


far below the optimum.

Sliding Window Protocols:

* In Sliding window protocol frames from a sending station are numbered sequentially,
which are included in its header. If the header of the frame allows m bits for the
sequence number, the sequence numbers range from 0 to 2m - 1.

* For example, if m is 3, the sequence numbers are 0 to7 inclusive. However, we can
repeat the sequence. So the sequence numbers are

0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1…

Sender sliding window:

* The size of the window in this protocol is fixed. The window slides to new unsent
frames when it receives the correct acknowledgements. Fig (a) and (b) illustrates the
sliding window before and after receiving the correct acknowledgements.

Fig (a). Before sliding

Fig (b). Slided window after receiving


acknowledgements for frames 0 and 1.

Receiver sliding window:

* The size of the window in this protocol is always 1. The receiver waits for a specific
frame to arrive in a specific order.

* Any frame arriving out of order is discarded and needs to be resent. The below fig
illustrates the receiving sliding window.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 62


Fig (a). Receiver waiting for
frame 3

Fig (b). Receiving window slide


to next frame after receiving
frame 3.

Sliding Window Protocols for Noisy Channels

i). Stop-and-Wait ARQ

* Stop-And-Wait protocol is also known as One bit sliding window protocol. In this
protocol, the sender sends out one frame, waits for an acknowledgment before
sending the next frame, thus the name Stop-And-Wait.

* In Stop-and-Wait ARQ the sending device keeps a copy of the last frame transmitted
until it receives an acknowledgement from the frame. This allows the sender to
retransmit if needed.

* For identification purposes, both data frames and acknowledgement frames are
numbered as 0 and 1 alternately.

* A data 0 frame is acknowledged by ACK1 frame indicating that the receiver received
the frame 0 and is now expecting the frame 1.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 63


* This numbering allows for identification of data frames in case of duplicate
transmission.

* The receiver sends positive ACK only for correctly received frames. It does not send
ACK if it receives a damaged or out of order frame.

* The sender starts a timer when it sends a frame. If the ACK is not received within an
allotted time period, the sender assumes that the frame was lost or damaged and
resends it. Since this frame is already received by the receiver it simply discards it.

* ARQ: Automatic repeat request is a process of retransmitting data when an error is


detected.

ii). Go-Back-N ARQ

* In Go-Back-N ARQ the sending process continues to send a number of frames


specified by a window size even without receiving an acknowledgement (ACK)
packet from the receiver.

* The send window can slide one after one slots when a valid acknowledgment arrives.

* The receiver process keeps track of the sequence number of the next frame it expects
to receive, and sends that number with every ACK it sends.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 64


* Frames 0, 1, 2, and 3 are sent. However, frame 1 is lost. The receiver receives frames
2 and 3, but they are discarded because they are received out of order.

* Sender received acknowledgement for frame 0 only. It didn’t receive any


acknowledgements for frame 1which is lost. Its timer finally expires.

* So the sender resend the frames 1,2 and 3 and it received acknowledgements for
them. Now Sender window slid to frame 4. It starts sending frames 4, 5, 6 and so on.
And the same process repeats.

* The sender sends the frames within its window continuously, and checks the
acknowledgements from the receiver before the time expires.

For example: Suppose the sender has already sent frame 6, but the timer for frame 3 expires.
This means that the frame 3 has not been acknowledged, so the sender goes back and sends
frames 3,4,5,6 again. This is why the protocol is called Go -Back N ARQ.

iii). Selective Repeat ARQ

* Go-Back-N ARQ protocol is very inefficient for a noisy link. In a noisy link a frame
has a higher probability of damage, which means the resending of multiple frames.

* This resending uses up the bandwidth and slows down the transmission. The
alternative method is Selective Repeat ARQ.

* With selective repeat protocol the sender continues to send a number of frames
specified by a window size even after a frame loss.

* The receiver process keeps track of the sequence number of the earliest frame it has
not received, and sends that number with every acknowledgement (ACK) it sends.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 65


* Selective repeat ARQ also defines a negative acknowledgement (NAK) that reports
the sequence number of a damaged frame before the time expires.

* Once the sender has sent all the frames in its window, it re-sends the frame number
given by the NAKs, and then continues where it left off. The size of the sending and
receiving windows must be equal.

* The next point is about the ACKs. Notice that only two ACKs are sent here. The first
one acknowledges only the first frame; the second one acknowledges three frames.

* In Selective Repeat, ACKs are sent when data are delivered to the network layer. If
the data belonging to n frames are delivered in one shot, only one ACK is sent for all
of them.

Piggybacking:

* Piggybacking is a bi-directional data transmission technique in the network layer. It is


a technique used to improve the efficiency of the bidirectional protocols.

* It is a method to combine a data frame with ACK. If station A and B both have to
send data, instead of sending separately, station A sends a data frame that includes an
ACK. Station B does the same thing.

* This practically means, that instead of sending an acknowledgement in an individual


frame it is piggy-backed on the data frame

* When a frame is carrying


data from A to B, it can
also carry control
information about
arrived (or lost) frames
from B,

* When a frame is carrying


data from B to A, it can
also carry control
information about the
arrived (or lost) frames
from A.

* An important point about


piggybacking is that both
sites must use the same
algorithm.

* This algorithm is complicated because it needs to combine two arrival events into one.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 66


4. MEDIUM ACCESS SUB LAYER

Channel Allocation

In broadcast networks, several stations share a single communication channel. The major
issue in these networks is which station should transmit data at a given time. This process of
deciding the turn of different stations is known as Channel Allocation. There are two
different methods of channel allocations:

i). Static Channel Allocation


ii). Dynamic Channel Allocation

i). Static channel allocation

* In static channel allocation, for N users, the bandwidth is divided into N equal-sized
portions each user being assigned one portion. This is efficient when there are only
a small number of users.

* However, when the number of senders is large and continuously varying or the traffic
is bursty, problems arise because some of the users will be denied permission for lack
of bandwidth, even if some of the users are not using the (allocated) bandwidth. Ex:
FDM and TDM.

ii). Dynamic Channel Allocation

* In this method, no user is assigned fixed frequency or fixed time slot. All users are
dynamically assigned frequency or time slot, depending upon the requirements of the
user. The five key assumptions in dynamic channel allocation are:

i). Station Model: In this model, there will be N independent users or stations, each user
generates separate frame for transmission. Once a frame has been generated, the station is
blocked and does nothing until the frame has been successfully transmitted.

ii). Single Channel Assumption: A single channel is available for communication. All
stations are equivalent, although the protocol software may assign priorities to them.

iii). Collision Assumption: If two frames are transmitted simultaneously, they will collide
each other. A collided frame must be retransmitted. All stations can detect collisions. There
are no errors other than those generated by collisions.

iv) a. Continuous Time: Frame transmission can begin at any instant. There is no master
clock dividing time into discrete intervals.

b. Slotted Time: Time is divided into discrete intervals (slots). Frame transmissions always
begin at the start of a slot. A slot may contain 0, 1, or more frames, corresponding to an idle
slot.

v) a. Carrier Sense: Stations sense the channel if the channel is busy, they wait until the
channel goes idle.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 67


v) b. No Carrier Sense: Stations cannot sense the channel. They just go ahead and transmit.
Only later can they determine whether the transmission was successful.

Multiple Access Protocols

* Many protocols have been defined to handle the access to shared link. These protocols
are organized in three different groups:

1. Random Access Protocols


2. Controlled Access Protocols
3. Channelization Protocols

The above protocols are further divided into several subgroups as shown in the below figure.

Random Access Protocols.

ALOHA: ALOHA was designed for radio broadcasting. In this method, stations share a
common channel. When two stations transmit simultaneously, a collision occurs and the
frames are lost.

There are two different versions of ALOHA:

i). Pure ALOHA


ii). Slotted ALOHA

* This method was later improved with the addition of sensing the medium before
transmitting known as carrier sense multiple access (CSMA).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 68


i). Classical (Pure) Aloha.

* This is a random access scheme, without a central arbiter controlling access and
without coordination among the stations. If two or more stations access the medium at
the same time, a collision occurs and the transmitted data is destroyed.

* In pure ALOHA system users transmit frames whenever they have data to be sent and
wait for the acknowledgement.

* If there is no acknowledgement within specified time the sender assumes that the
frame is damaged due to collision and just waits a random amount of time and sends it
again. This process continuous until the sender receives the acknowledgement. The
limit for maximum number of attempts is normally 15.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 69


Vulnerable time for pure ALOHA protocol:

Fig. Vulnerable time for pure ALOHA protocol.

* The vulnerable time is 2Tfr. If Tfr is 1 ms then vulnerable time = 2 ms. This means no
station should send later than 1 ms before this station starts transmission and no
station should start sending during the one 1-ms period that this station is sending.

The throughput of pure ALOHA:

The throughput of pure ALOHA is given by S = G * e-2G.


The maximum throughput Smax = 0.184 when G=1/2.

Example: A pure ALOHA network transmits 200-bit frames on a shared channel of 200
kbps. What is the throughput if the system (all stations together) produces?
a. 1000 frames per second b. 500 frames per second c. 250 frames per second.

Solution: The frame transmission time is 200/200 kbps or 1 ms.

a). If the system creates 1000 frames per second, this is 1 frame per millisecond. The load is
1. In this case S = G× e−2G or S = 0.135 (13.5 percent). This means that the throughput is
1000 × 0.135 = 135 frames. Only 135 frames out of 1000 will probably survive.

b). If the system creates 500 frames per second, this is (1/2) frame per millisecond. The load
is (1/2). In this case S = G × e −2G or S = 0.184 (18.4 percent). This means that the throughput
is 500 × 0.184 = 92 and that only 92 frames out of 500 will probably survive. Note that this is
the maximum throughput case, percentage wise.

c). If the system creates 250 frames per second, this is (1/4) frame per millisecond. The load
is (1/4). In this case S = G × e −2G or S = 0.152 (15.2 percent). This means that the throughput
is 250 × 0.152 = 38. Only 38 frames out of 250 will probably survive.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 70


ii). Slotted Aloha.

* Refinement of the classical Aloha scheme is provided by the introduction of time slots
(slotted Aloha).

* In this case, all senders have to be synchronized, transmission can only start at the
beginning of a time slot as shown in the below figure.

Vulnerable time for slotted ALOHA protocol:

Fig. Vulnerable time for slotted ALOHA protocol.

* Vulnerable time for slotted ALOHA protocol is Tfr. The introduction of slots raises
the throughput from 18 per cent to 36 per cent, i.e., slotting doubles the throughput.
Both Aloha systems work perfectly well under a light load, but they cannot give any
hard transmission guarantees.

The throughput of slotted ALOHA:

The throughput for slotted ALOHA is S = G × e−G .


The maximum throughput Smax = 0.368 when G = 1.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 71


Example: A slotted ALOHA network transmits 200-bit frames on a shared channel of 200
kbps. What is the throughput if the system (all stations together) produces a. 1000 frames per
second b. 500 frames per second c. 250 frames per second.

Solution: The frame transmission time is 200/200 kbps or 1 ms.


a). If the system creates 1000 frames per second, this is 1 frame per millisecond. The load is
1. In this case S = G× e−G or S = 0.368 (36.8 percent). This means
that the throughput is 1000 × 0.0368 = 368 frames. Only 386 frames out of 1000 will
probably survive.

b). If the system creates 500 frames per second, this is (1/2) frame per millisecond. The load
is (1/2). In this case S = G × e−G or S = 0.303 (30.3 percent). This means that the throughput
is 500 × 0.0303 = 151. Only 151 frames out of 500 will probably survive.

c). If the system creates 250 frames per second, this is (1/4) frame per millisecond. The load
is (1/4). In this case S = G × e e−G or S = 0.195 (19.5 percent). This means that the throughput
is 250 × 0.195 = 49. Only 49 frames out of 250 will probably survive.

Carrier Sense Multiple Access Protocols (CSMA).

* CSMA method was developed to minimize the chance of collision, which can be
reduced if a station senses the medium before trying to use it. In this method each
station first listens to the medium (or check the state of the medium) before sending.

* In other words, CSMA is based on the principle "sense before transmit" or "listen
before talk."

Fig. Vulnerable time in CSMA.

* CSMA can reduce the possibility of collision, but it cannot eliminate it because of
propagation delay; when a station sends a frame, it still takes time (although very
short) for the first bit to reach every station and for every station to sense it.

The different versions (schemes) of CSMA are:

1-persistent CSMA
p-persistent CSMA
non-persistent CSMA

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 72


i). 1-persistent CSMA.

* In this method, a station that wants to transmit data continuously senses the channel to
check whether the channel is idle or busy. If the channel is busy, the station waits
until it becomes idle. When the station detects an idle-channel, it immediately
transmits the frame with probability 1. Hence it is called I-persistent CSMA.

* This method has the highest chance of collision because two or more stations may
find channel to be idle at the same time and transmit their frames. When the collision
occurs, the stations wait a random amount of time and start all over again.

ii). p-persistent CSMA.

* In this method the channel has time slots such that the time slot duration is
equal to or greater than the maximum propagation delay time. If the channel is busy,
station waits until next slot. If the channel is idle, it transmits with a probability p.

iii). non-persistent CSMA.

* Station senses the carrier, if the medium is busy, it waits for a random amount of time
and then senses the channel again. If it is idle it starts sending frame immediately.

* The non persistent approach reduces the chance of collision because it is unlikely that
two or more stations will wait the same amount of time and retry to send
simultaneously.

* CSMA or Carrier Sense Multiple Access method does not specify the procedure
following a collision.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 73


CSMA/CD.

CSMA/CD (Collision Detection): specifies certain rules as stated below.

i). Sense the medium, if the medium is idle, transmit; otherwise, go to step 2.

ii). If the medium is busy, continue to listen until the channel is idle, once the channel is idle
then transmit immediately.

iii). If a collision is detected during transmission, transmit a brief jamming signal to assure
that all stations know that there has been a collision and then cease transmission.

iv). After transmitting the jamming signal, wait a random amount of time, then attempt to
transmit again. (Repeat from step 1.)

Fig. Flow diagram of CSMA/CD

Example: A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum


propagation time (including the delays in the devices and ignoring the time needed to send a
jamming signal) is 25.6 μs, what is the minimum size of the frame?

Solution: The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst
case, a station needs to transmit for a period of 51.2 μs to detect the collision. The minimum
size of the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is actually the minimum
size of the frame for Standard Ethernet.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 74


The Binary Exponential Backoff Algorithm.

* After a collision, time is divided into discrete slots whose length is equal to the worst-
case round-trip propagation time on the ether (2t). To accommodate the longest path
allowed by Ethernet, the slot time has been set to 512 bit times, or 51.2 µsec.

* After the first collision, each station waits either 0 or 1 slot times before trying again.
If two stations collide and each one picks the same random number, they will collide
again.

* After the second collision, each one picks either 0, 1, 2, or 3 at random and waits that
number of slot times.

* If a third collision occurs (the probability of this happening is 0.25), then the next
time the number of slots to wait is chosen at random from the interval 0 to 23 - 1.

* In general, after i collisions, a random number between 0 and 2i - 1 is chosen, and that
number of slots is skipped. However, after ten collisions have been reached, the
randomization interval is frozen at a maximum of 1023 slots. Truncating the backoff
at 1023 keeps the bound from growing too large.

* After 16 collisions, the controller reports failure back to the computer. Further
recovery is up to higher layers. This algorithm, called binary exponential backoff, was
chosen to dynamically adapt to the number of stations trying to send.

Wireless LANs cannot implement CSMA/CD for three reasons:

* In a wired network, the sent and received signal has almost the same energy so when
a collision occurs, the detected energy is almost double as shown in the figure.

i). For collision detection a station must be able to send data and receive collision signals at
the same time. This can mean costly stations and increased bandwidth requirements.

ii). Collision may not be detected because of the hidden station problem.

iii). The distance between stations can be great. Signal fading could prevent a station at one
end from hearing a collision at the other end.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 75


CSMA/CA.

* Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for
wireless network. In this method the station uses one of the persistence strategies.

* Here even though an idle channel is found, the station does not send immediately. It
waits for a period of time called the inter-frame space or IFS. It then waits for a
random amount of time.

* After that it sends the frame and sets a timer. If it receives an acknowledgement
before the time expires the transmission is successful, if not it waits for the backoff
time and re-senses the line.

* In CSMA/CA, if the station finds the channel busy, it does not restart the timer of the
contention window; it stops the timer and restarts it when the channel becomes idle.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 76


Collision Free Protocols.

* In controlled access or collision free protocols, the stations consult one another to find
which station has the right to send. A station cannot send unless it has been authorized
by other stations.

i). Bit map protocol.

* This is also like a reservation protocol where, a station needs to make a reservation
before sending data. Time is divided into intervals.

* If there are N stations in the system, there are exactly N slots in the reservation frame.
Each slot belongs to a station. When a station needs to send a data frame, it puts 1 in
its own slot.

* The stations that have


made reservations can send
their data frames after the reservation frame.

* Figure illustrates the reservation system. In the first interval, only stations 1, 3, and 7
had made reservations.
* In the second interval, stations 1 and 5 have made the reservation. In each interval, a
reservation frame precedes the data frames sent in that interval.
ii). Binary Countdown.

* A problem with the basic bit-map protocol is that the overhead is 1 bit per station, so
it does not work well when there are a large number of stations. Binary countdown is
more efficient.

* Here a station broadcasts its address as a binary bit


string. All addresses are assumed to be the same
length. The bits in each address position from
different stations are BOOLEAN ORed together.

* For example, if stations 0010, 0100, 1001, and 1010


are all trying to get the channel, in the first bit time
the stations transmit 0, 0, 1, and 1, respectively.
These are ORed together to form a 1.

* Stations 0010 and 0100 see the 1 and know that a higher-numbered station is
competing for the channel, so they give up for the current round. Stations 1001 and
1010 continue.

* The next bit is 0, and both stations continue. The next bit is 1, so station 1001 gives
up. Station 1010 has the highest address, so it may now transmit a frame, after which
another bidding cycle starts. It has the property that higher- numbered stations have a
higher priority than lower-numbered stations.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 77


Controlled (schedule) Access Protocols.

* In controlled access, the stations consult one another to find which station has the
right to send. A station cannot send unless it has been authorized by other stations.

The three popular controlled-access methods.

1. Reservation (Bit map protocol)


2. Polling
3. Token passing

i). Reservation.

* In the reservation method, a station needs to make a reservation before sending data.
Time is divided into intervals. In each interval, a reservation frame precedes the data
frames sent in that interval.

* If there are N stations in the system, there are exactly N reservation mini slots in the
reservation frame. Each mini-slot belongs to a one station. When a station needs to
send a data frame, it makes a reservation in its own mini-slot. The stations that have
made reservations can send their data frames after the reservation frame.

* The above figure shows a situation with five stations and a five-minislot reservation
frame. In the first interval, only stations 1, 3, and 4 had made reservations. In the
second interval, only station 1 has made a reservation.

ii). Polling.

* Polling works with topologies in which one device is designated as a primary station
and the other devices are secondary stations. All data exchanges must be made
through the primary device even the destination is a secondary device. The primary
device controls the link. It determines which device is allowed to use the channel at a
given time.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 78


* If the primary wants to receive data, it asks the secondary’s, if they have anything to
send; this is called a poll function. If the primary wants to send data, it tells the
secondary to get ready to receive; this is called a select function.

Select: The select function is used whenever the primary device wants to send something. To
alert the secondary before sending data, the primary transmits a select (SEL) frame,
one field, of which includes the address of the intended secondary.

Poll: The poll function is used by the primary device to solicit (ask for) transmissions from
the secondary devices. When the primary is ready to receive data, it must ask (poll)
each device in turn if it has anything to send.

* It approaches the first secondary, If the response is negative (a NAK frame), it polls
the next secondary and so on, until it finds one with data to send. When the response
is positive (a data frame), the primary reads the frame and returns an acknowledgment
(ACK frame), verifying its receipt.

iii). Token Passing.

* In the token-passing method, the stations are organized in a logical ring. In other
words, for each station, there is a predecessor and a successor.

* A special packet called a token circulates through the ring. When a station has some
data to send, it waits until it receives the token from its predecessor. Once the data is
sent, it releases the token. If a station receives the token and has no data to send, it just
passes to the next station.

Token management: Stations must be limited in the time they can have possession of the
token. The token must be monitored to ensure it has not been lost or destroyed. For example,
if a station that is holding the token fails, the token will disappear from the network.

* Another function is to assign priorities to the stations. Token management manages


the low priority stations to release the token to high priority stations.

Logical Ring: In a token-passing network, stations do not have to be physically connected in


a ring; the ring can be a logical one as shown in the below figures.

a). Bus ring topology, b). Star ring topology, c). The dual ring topology.

* The dual ring topology uses a second (auxiliary) ring which operates in the reverse
direction compared with the main ring. The second ring is used only when the main
ring fails. The FDDI (Fiber Distributed Data Interface) and CDDI (Copper Distributed
Data Interface) use this topology.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 79


Channelization.

* Channelization is a multiple-access method in which the available bandwidth of a link


is shared in time, frequency, or through code, between different stations. The three
channelization protocols: FDMA, TDMA, and CDMA.

i). Frequency-Division Multiple Access (FDMA).

* In frequency-division multiple access (FDMA), the available bandwidth is divided


into frequency bands. Each station is allocated (reserved) a band to send its data and it
belongs to the station all the time. To prevent station interferences, the allocated
bands are separated by small guard bands.

FDMA specifies a predetermined frequency band for the entire period of communication.

ii). Time-Division Multiple Access (TDMA).

* In time-division multiple access (TDMA), the stations share the bandwidth of the
channel in time. Each station is allocated a time slot during which it can send data.
Each station transmits its data in is assigned time slot.

* Synchronisation is the main problem with TDMA. Each station needs to know the
beginning of its slot and the location of its slot. Synchronization is normally
accomplished by having some synchronization bits (normally referred to as preamble
bits) at the beginning of each slot.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 80


iii). Code-Division Multiple Access (CDMA).

* In Code-division multiple access (CDMA) only one channel occupies the entire
bandwidth of the link. There is no time sharing, all stations can send data
simultaneously.

* Analogy: CDMA simply means communication with different codes. For example, in
a large room with many people, two people can talk in English if nobody else
understands English. Another two people can talk in Telugu if they are the only ones
who understand Telugu, and so on.

Example: Let us assume we have four stations 1, 2, 3, and 4 connected to the same channel.
The data from station 1 are d1, from station 2 are d2, and so on. The code assigned to the first
station is c1, to the second is c2, and so on. We assume that the assigned codes have two
properties.

1. If we multiply each code by another, we get 0.


2. If we multiply each code by itself, we get 4 (the number of stations).

* With these two properties in mind, let us see how the above four stations can send
data using the same common channel, as shown in the below figure.

* Station 1 multiplies its data by its code to get dl * c1. Station 2 multiplies its data by
its code to get d2*c2 and so on. The data that go on the channel are the sum of all
these terms, as shown in the box.

* Any station that wants to receive data from one of the other three, multiplies the data
on the channel by the code of the sender.

* For example, suppose stations 1 and 2 are talking to each other. Station 2 wants to
hear what station 1 is saying. It multiplies the data on the channel by c l the code of
station 1.

* Because (cl . cl) is 4, but (c2 . cI), (c3 . cI), and (c4 . cl) are all 0s, station 2 divides the
result by 4 to get the data from station 1.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 81


Orthogonal Code (sequence):

* CDMA is based on coding theory. Each station is assigned a code, which is a


sequence of numbers called chips, as shown in the below figure.

The sequences selected are called orthogonal sequences and have the following properties:

i). Each sequence is made of N elements, where N is the number of stations.

ii). If we multiply a sequence by a number, every element in the sequence is multiplied by


that element. This is called multiplication of a sequence by a scalar.

For example: 2 x [+1 +1-1-1] = [+2+2-2-2]

iii). If we multiply two equal sequences, element by element, and add the results, we get N,
where N is the number of elements in the each sequence. This is called the inner product of
two equal sequences.

For example: [+1 +1-1 -1] x [+1 +1 -1 -1] = 1 + 1 + 1 + 1 = 4

iv). If we multiply two different sequences, element by element, and add the results, we get 0.
This is called inner product of two different sequences.

For example: [+1 +1 -1 -1] x [+1 +1 +1 +1] = 1 + 1 - 1 - 1 = 0

v). Adding two sequences means adding the corresponding elements. The result is another
sequence.

For example: [+1+1-1-1]+[+1+1+1+1] = [+2+2 0 0] = 4

Data Representation:

* We follow these rules for encoding: If a station needs to send a 0 bit, it encodes it as -
1; if it needs to send a 1 bit, it encodes it as +1. When a station is idle, it sends no
signal, which is interpreted as a 0. These are shown in the below figure.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 82


Encoding and Decoding:

* As a simple example, we show how four stations share the link during a 1-bit interval.
We assume that stations 1 and 2 are sending a 0 bit, tation 3 is silent and channel 4 is
sending a 1 bit.. The data at the sender site are translated to -1, -1, 0, and +1.

* Each station multiplies the corresponding number by its chip (its orthogonal
sequence), which is unique for each station. The result is a new sequence which is
sent to the channel.

* Let us assume that all stations send the resulting sequences at the same time. The
sequence on the channel is the sum of all four sequences as defined before.

* Now imagine station 3, which we said is silent, is listening to station 2. Station 3


multiplies the total data on the channel by the code for station 2, which is

[+1 -1 +1-1], to get [-1 -1 -3 +1]* [+1-1 +1-1] = -4/4 = -1  (bit 1)

IEEE 802.X:

* In 1985, the Computer Society of the IEEE started a project, called Project 802, to set
standards to enable intercommunication among equipment from a variety of
manufacturers.

* Project 802 specifies the functions of the physical layer and the data link layer of
major LAN protocols. The IEEE has subdivided the data link layer into two sub
layers: logical link control LLC (IEEE 802.2) and media access control MAC (802.3).

* IEEE has also created several physical layer standards for different LAN protocols.
The relationship of the 802 Standard to the traditional OSI model is shown in the
below Figure (IEEE standard for LANs).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 83


1. Data Link Layer:

The data link layer in the IEEE standard is divided into two sub layers:

1. Logical Link Control (LLC)


2. Media Access Control (MAC)

i). Logical Link Control (LLC): Typical usage of LLC is as follows.

* The network layer on the sending machine passes a packet to LLC, using the LLC
access primitives.

* The LLC sublayer, then adds an LLC header, containing sequence and
acknowledgement numbers.

* The resulting structure is then inserted into the payload field of an 802 frame and
transmitted. At the receiver, the reverse process takes place.

LLC provides three service options:

i). Unreliable datagram service,


ii). Acknowledged datagram service, and
iii). Reliable connection-oriented service.

LLC header contains three fields:

a). A destination
access point,
b). A source
access point, and
c). A control field.

* The access points tell which process the frame came from and where it is to be
delivered. The control field contains sequence and acknowledgement numbers. These
fields are primarily used when a reliable connection is needed at the data link level.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 84


ii). Media Access Control (MAC):

* IEEE Project 802 has created a sublayer called media access control that defines the
specific access method for each LAN. For example, it defines CSMA/CD as the
media access method for Ethernet LANs and the token passing method for Token
Ring and Token Bus LANs.

* The MAC sublayer contains a number of distinct modules; each defines the access
method and the framing format specific to the corresponding LAN protocol.

2. Physical Layer: The physical layer is dependent on the implementation and type of
physical media used.

* IEEE defines detailed specifications for each LAN implementation. For example,
although there is only one MAC sublayer for Standard Ethernet, there is a different
physical layer specification for each Ethernet implementation.

* Ethernet is a local-area network (LAN) architecture developed by Xerox Corporation


in 1976. It uses a bus or star topology. Standard (or traditional) Ethernet supports data
transfer rate up to 10 Mbps. Later, Fast Ethernet (100Mbps), Gigabit Ethernet (1,000
Mbps) are developed.

Standard Ethernet

* The Standard Ethernet specification known as IEEE 802.3 standard, uses the
CSMA/CD access method to handle simultaneous demands. It is one of the most
widely implemented LAN standards.

Categories of Standard Ethernet.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 85


1. Physical Layer: The Standard Ethernet defines several physical layer implementations;
four of the most common, are shown in the figure.

Ethernet Cabling: Three types of cables are commonly used in Ethernet networks.

a). Coaxial: Coaxial cable is subdivided into Thick coaxial (10Base 5) and thin coaxial
(10Base 2) basing on the thickness of the wire used. Thick coaxial supports up to 500 meters
and Thin coaxial supports up to 185 m.

b). Twisted pair: Twisted pair (10 Base-T) comes in two types, Shielded twisted pair (STP)
and Unshielded twisted pair (UTP). UTP is most commonly used and very economical
medium. These are further categorized as

Cat 3 – used for voice cabling and 10Mb Ethernet;

Cat 5 – used for 10/100Mb Ethernet and works for voice as well;

Cat 5E – Enhanced Cat 5 cabling that helps to prevent crosstalk, works for 10/100Mb and
1000Mb (or Gigabit Ethernet);

Cat 6 – Like Cat 5E but with larger gauge wires, works for 10/100/1000Mb. Etc

c). Fiber optic: Fiber optic (10Base-F) uses fiber optic cable. This is expensive due to the
cost of the connectors and terminators, but it has excellent noise immunity and supports long
distances.

* Although there are several types of optical fiber 10-Mbps Ethernet, the most common
is called 10Base-F. 10Base-F uses a star topology to connect stations to a hub.

Summary of standard Ethernet:

Name Media Max. Length


10 Base 5 Thick Coaxial 500 m
10 Base 2 Thin Coaxial 185 m
10 Base T Twisted Pair 100 m
10 Base F Fiber Optics 2000 m

Encoding in a Standard Ethernet implementations

* In the data transmission both idle state and low state are represented by 0 so it is
difficult to distinguish between them. To solve this problem 1 is represented by +1
volts and 0 is represented by -1 volts.

* Synchronizing clock speeds between the sender and receiver is another problem. Two
types of encoding techniques Manchester encoding and differential Manchester
encoding are used to determine the start, end, or middle of each bit without reference
to an external clock.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 86


i). Manchester encoding:

In Manchester encoding, each bit period is divided into two equal intervals.
- A binary 1 bit is sent as high at the first interval and low in the second interval.
- A binary 0 is just the reverse: first low and then high.

* This scheme ensures that every bit period has a transition in the middle, making it
easy for the receiver to synchronize with the sender.

* A disadvantage of Manchester encoding is that it requires twice as much bandwidth as


straight binary encoding because the pulses are half the width. For example, to send
data at 10 Mbps, the signal has to change 20 million times/sec. Manchester encoding
is shown in the below figure.

ii). Differential Manchester encoding:

* In Differential Manchester encoding, 1 bit is indicated by the absence of a transition


at the start of the interval. 0 bit is indicated by the presence of a transition at the start
of the interval. In both cases, there is a transition in the middle as well.

* Ethernet systems use Manchester encoding due to its simplicity, other LANs (e.g., the
802.5 token ring) use differential Manchester encoding, but other LANs. The
differential scheme requires more complex equipment, but offers better noise
immunity.

The Ethernet MAC Sublayer Protocol.

* In Standard Ethernet, the MAC sublayer governs the operation of the access method.
It also frames data received from the upper layer and passes them to the physical
layer.

Ethernet Frame format.

* The Ethernet frame contains seven fields: preamble, SFD, DA, SA, length or type of
the protocol data unit (PDU), upper-layer data, and the CRC.

* Ethernet does not provide any mechanism for acknowledging received frames,
making it what is known as an unreliable medium. Acknowledgments must be
implemented at the higher layers. The format of the MAC frame is shown below.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 87


i). Preamble: Each frame starts with a Preamble of 7 bytes (56 bits) of alternating 1’s and
0’s. This allows the receiver's clock to synchronize with the sender's. The preamble is
actually added in the physical layer and not (formally) a part of the frame.

ii). Start-of-frame delimiter (SFD): The second field (1 byte: 10101011) signals the
beginning of the frame. The last 2 bits are 11 and alert the receiver that the next field is the
destination address.

IEEE 802.3 Frame: (MAC Frame)

iii). Destination address (DA): The DA field is 6 bytes. The DA field identifies which
station(s) should receive the frame.

iv). Source addresses (SA): The SA field is 6 bytes and contains the physical address of the
sender of the packet.

v). Type/Length of protocol data unit (PDU): 2 bytes. This field is defined as a type field
or length field.

If the value of the field is less than (< 1518 bytes) it defines the length of the field. Else if the
value is greater than (> 1518 bytes), it defines the type of the PDU packet that is encapsulated
in the frame.

vi). Data and Padding: Data including can be minimum 46 bytes and maximum up to 1500
bytes. If the data portion of a frame is less than 46 bytes, the Pad field is used to fill out the
frame to the minimum size.

vii). CRC: Uses 4 bytes. The CRC (cyclic redundancy check) checksum algorithm uses 4
bytes (32 bit) for error detection, not forward error correction.

Frame Length:

Ethernet has imposed restrictions on both the minimum and maximum lengths of a frame, as
shown in the below figure.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 88


i). Minimum frame length.

* An Ethernet frame needs to have a minimum length of 512 bits or 64 bytes. If the data
portion of a frame is less than 46 bytes, the Pad field is used to fill out the frame to the
minimum size.

Slot Time:

* In an Ethernet network, the round-trip time plus the time needed to send the jam
sequence is called the slot time. It is the time required for a station to send 512 bit
times or 51.2µs.

* Let us assume that the sender sends a minimum-size packet of 512 bits. Before the
sender can send the entire packet out, the signal travels through the network and
reaches the end of the network.

* If a collision occurs, the sender aborts its transmission and generates a 48-bit noise
burst (jam sequence) to inform other stations of the collision. It then waits a random
time before trying again.

* If the sender sends a frame larger than the minimum size (between 512 and 1518 bits).
In this case, if the station has sent out the first 512 bits and has not heard a collision, it
is guaranteed that collision will never occur during the transmission of this frame.

* Because all the stations follow the CSMA/CD protocol, they have already sensed the
existence of the signal (carrier) on the line and have refrained from sending.

ii). Maximum length of a frame.

* The standard defines the maximum length of a frame (without preamble and SFD
field) as 1518 bytes. Payload 1500 bytes plus 18 bytes of header and trailer. The
maximum length restriction has two historical reasons.

* First, memory was very expensive when Ethernet was designed: a maximum length
restriction helped to reduce the size of the buffer.

* Second, the maximum length restriction prevents one station from monopolizing the
shared medium, blocking other stations that have data to send.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 89


Fast Ethernet (802.3u)

* Fast Ethernet was designed to compete with LAN protocols such as FDDI (fibre
distributed data interface) or Fiber Channel. IEEE created Fast Ethernet under the
name 802.3u (u indicates auto negotiation)

* Auto negotiation allows two devices to negotiate the mode or data rate of operation
(for Ex: 10Mbps or 100 Mbps).

* Fast Ethernet is backward-compatible with Standard Ethernet. It can transmit data 10


times faster at a rate of 100 Mbps. It supports both half duplex and full duplex.

* In the full-duplex approach, the connection is made via a switch with buffers at each
port.

Fast Ethernet implementation at the physical layer can be categorized as either two-pair or
four-pair.

* The two-pair implementation can be either category 5 UTP (100Base-TX) or fiber-


optic cable (100Base-FX). Supports bit rate from 100 to 125 Mbps.

* The four-pair implementation is designed to use category 3 or higher UTP (l00Base-


T4) for transmitting 100 Mbps. Three pairs are utilized in both the directions.

* Each twisted-pair handles 33.33 Mbps. One pair is used for carrier sense /collision
detection.

Name Media Type/Cat No. of wires Max. Length


100Base-T4 TP Cat 4 UTP 4 100 m
100Base-TX TP Cat 5 UTP 2 100 m
100Base-FX Fiber Fiber 2 2000m

Physical Layer Topology

* Fast Ethernet is designed to connect two or more stations together. If there are only
two stations, they can be connected point-to-point.

* Three or more stations need to be connected in a star topology with a hub or a switch
at the center, as shown in the below figure. (Bus topologies are dropped in fast
Ethernet).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 90


Gigabit Ethernet (802.3z)

* In a gigabit Ethernet all configurations are point to point rather than multidrop, two
computers are directly connected to each other most commonly via a switch or a hub.
This can be extended to multiple computers using additional switches or hubs as
illustrated in the below figure. Autoconfiguration is supported just as in fast Ethernet.

* Gigabit Ethernet supports two different modes of operation: full-duplex mode and
half-duplex mode.

i). Full duplex mode:

* The ''normal'' mode is full-duplex mode, which allows traffic in both the directions at
the same time. This mode is used when there is a central switch connected to
computers. Since this is point to point configuration and all the lines are buffered,
there will be no contention and collisions so the CSMA/CD protocol is not used.

ii). Half-duplex mode:

* Half-duplex, is used when the computers are connected to a hub rather than a
switch. A hub does not buffer incoming frames. Instead, it electrically connects all
the lines internally, simulating the multidrop cable used in classic Ethernet. In this
mode, collisions are possible, so the standard CSMA/CD protocol is required.

* Gigabit Ethernet supports both copper and fiber cabling. In case of fiber, lasers with
wavelengths 0.85 microns (Short) and 1.3 microns (Long) are used. (Here the light
source has to be turned on and off in under 1 nsec).

Various cables and their maximum support distances are given below.

Name Media Type/Cat No. of wires Max. Length


1000Base-T TP UTP 4 100 m
1000Base-CX TP STP 2 25 m
1000Base-SX Fiber Multi mode 2 550 m
1000Base-LX Fiber Single/Multi 2 5000 m

* A speed of 1 Gbps is quite fast. For example, if a receiver is busy with some other
task for even 1 msec and does not empty the input buffer on some line, up to 1953
frames may have accumulated there in that 1 ms gap.

* Gigabit Ethernet supports flow control. The flow control consists of one end sending a
special control frame to the other end telling it to pause for some period of time.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 91


Switched Ethernet

* In switched Ethernet SWITCH is used instead of HUB. A switch is an intelligent


device with a special circuit built-in designed to manage a set of separate point-to-
point circuits. In switch each circuit connected to a switch is not shared with any other
devices except the switch and the attached computer.

* The physical topology is star, but its logical topology is a set of separate point-to-
point circuits.

Fig. Switched Ethernet.

* When the switch first switched ON it acts like a hub. Because it’s forwarding table is
empty. It learns the addresses from the incoming and outgoing packets and builds the
forwarding table.

* When a switch receives a frame, it reads the frame’s data link layer source address
and compares this address in its forwarding table. If the address is not in the
forwarding table, the switch adds it, along with the port on which the frame was
received.

* If a switch receives a frame with a destination address that is not in the forwarding
table, it retransmit the frame to all ports, except the one on which the frame was
received.

* The computer for whom the frame is addressed will recognize its address and sends
ACK or a NAK back to the sender. When the switch receives the ACK or NAK, it
will add this computer’s address and the port number on which the ACK or NAK was
received to its forwarding table.

* As soon as its forwarding table is complete, it begins to act more and more like a
switch. In a busy network, it takes only a few minutes for the switch to learn most
addresses and match them to port numbers.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 92


Types of Switches: There are three types of switches. Functioning wise all are same, but the
manner in which they work internally is different.

i). Cut Through Switching.

* Cut through switches begin to transmit the incoming packet as soon as it has read the
destination address in the frame. In other words, the switch begins transmitting before
it has received the entire frame.

* The advantage of this is low latency and results in a very fast network. The
disadvantage is that the switch begins transmitting before it has read and processed
the frame check sequence at the end of the frame; the frame may contain an error, but
the switch will not notice until after almost all of the frame has been transmitted.

* Cut through switching can only be used when the incoming data circuit has the same
data rate as the outgoing circuit.

ii). Store and Forward Switching:

* Store and forward switch do not begin transmitting until it has received the entire
incoming frame. It checks for errors, if there are no errors, then the switch to begin
transmitting the frame on the outgoing circuit. If errors are found, the switch simply
discards the frame.

* This mode prevents invalid frame from consuming network capacity, but provides
higher latency and thus results in a slower network. Store and forward switching can
be used regardless of whether the incoming data circuit has the same data rate as the
outgoing circuit because the entire frame must be stored in the switch before it is
forwarded on its way.

iii). Fragment-Free Switching (Hybrid).

* With fragment-free switching, the first 64 bytes of the frame are read and stored. The
switch examines the first 64 bytes (which contain all the header information for the
frame) and if all the header data appears correct, the switch presumes that the rest of
the frame is error free and begins transmitting.

* Fragment-free switching is a compromise between cut through and store and forward
switching because it has higher latency and better error control than cut through
switching, but lower latency and worse error control than store and forward
switching. Most switches today use cut through or fragment-free switching.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 93


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 94


5. IEEE 802.11 (Wireless LAN)

The 802.11 Protocol Stack:

* The protocols used by all the 802 variants, including Ethernet, have a certain
commonality of structure.

* The physical layer


corresponds to the OSI
physical layer.

* The data link layer in all


the 802 protocols is split
into two or more sub
layers.
MAC sublayer and LLC.

IEEE 802.11 MAC Sublayers:

IEEE 802.11 defines two MAC sub layers:

a). Distributed coordination function (DCF) and


b). Point coordination function (PCF).

a). Distributed Coordination Function (DCF)

Distributed coordination function (DCF) uses CSMA/CA as the access method.

i). Frame Exchange: Time Line Figure shows the exchange of data and control frames.

* Before sending a frame, the source station senses the medium (by checking the energy
level at the carrier frequency).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 95


* The channel uses a persistence strategy with back-off until the channel is idle.

* After the station is found to be idle, the station waits for a period of time called the
distributed inter frame space (DIFS); then the station sends a control frame called the
request to send (RTS).

* After receiving the RTS and waiting a period of time called the short inter frame
space (SIFS), the destination station sends a control frame, called the clear to send
(CTS), to the source station. This control frame indicates that the destination station is
ready to receive data.

* The source station sends data after waiting an amount of time equal to SIFS.

* The destination station, after waiting an amount of time equal to SIFS, sends an
acknowledgment to show that the frame has been received.

ii). Network Allocation Vector

* When a station sends an RTS frame, it includes the duration of time that it needs to
occupy the channel.

* Other stations create a timer called a network allocation vector (NAV) that shows
how much time they have to wait to check the channel for idleness.

* Each time a station accesses the system and sends an RTS frame, other stations start
their NAV.

* In other words, each station, before sensing the physical medium to see if it is idle,
first checks its NAV to see if it has expired.

iii). Collision During Handshaking

* If two or more stations try to send RTS frames at the same time. There may be a
collision.

* Since there is no mechanism for collision detection, the sender assumes there has been
a collision if the CTS frame is not received from the receiver.

* The back-off strategy is employed, and the sender tries again.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 96


b). Point Coordination Function (PCF):

* The point coordination function (PCF) can be implemented in an infrastructure


network (not in an ad hoc network) on top of the DCF.

* PCF has a centralized, contention-free polling access method.

* The Access Point performs polling and all stations are polled one after another,
sending any data they have to the AP.

* The SIFS (short inter-frame spaces) is same as that in DCF, but the PIFS (PCF IFS) is
shorter than the DIFS.

* A repetition interval has been designed to cover both contention-free (PCF) and
contention-based (DCF) traffic.

* The repetition interval starts with a special control frame, called a beacon (B) frame.

* When the stations hear the beacon frame, they start their NAV for the duration of the
contention-free period of the repetition interval.

* During the repetition interval, the PC (point controller) can send a poll frame, receive
data, send an ACK, receive an ACK etc,. (802.11 uses piggybacking).

* At the end of the contention-free period, the PC sends a CF end (contention-free end)
frame to allow the contention-based stations to use the medium.

Fragmentation:

* The wireless environment is very noisy; a corrupt frame has to be retransmitted. The
protocol, therefore, recommends fragmentation (the division of a large frame into
smaller ones). It is more efficient to resend a small frame than a large one.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 97


Frame Format.

The MAC layer frame consists of nine fields, as shown in the below figure.

i). Frame control (FC): The FC field is 2 bytes long and defines the type of frame and
some control information. Below table describes the subfields.

ii). D: This field defines the duration of the transmission that is used to set the value of
NAV. In one control frame, this field defines the ID of the frame.

iii). Addresses: There are four address fields, each 6 bytes long. The meaning of each
address field depends on the value of the To DS and From DS subfields.

iv). Sequence control (SC): This field defines the sequence number of the frame to be
used in flow control.

v). Frame body: This field, which can be between 0 and 2312 bytes, contains
information based on the type and the subtype defined in the FC field.

vi). FCS: The FCS field is 4 bytes long and contains a CRC-32 error detection sequence.

Subfields in FC fields:

Values of subfields in control frames:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 98


Hidden and exposed terminals:

* Consider the scenario with three stations as shown below. The transmission range of
B reaches A, but not C (the detection range does not reach C either).

* The transmission range of C reaches A, but not B. Finally, the transmission range of
A reaches B and C, i.e., B cannot detect C and vice versa.

i). Hidden Station Problem:

* B sends to A, C cannot hear B

* C wants to send to A, C senses


a “free” medium (CS fails) and
starts transmitting

* Collision at A occurs, B cannot


detect this collision (CD fails) and continues with its transmission to A.

* B is “hidden” from C and vice versa.

MACA and MACAW:

An early protocol designed for wireless LANs is MACA (Multiple Access with Collision
Avoidance). In this protocol the sender stimulate the receiver into outputting a short frame, so
stations nearby can detect this transmission and avoid transmitting for the duration of the
upcoming (large) data frame. MACA is illustrated in the Fig.

* Let us now consider how B sends a frame to A. B starts by sending an RTS (Request
To Send) frame to A. This short frame (30 bytes) contains the length of the data frame
that will eventually follow.

* Then A replies with a CTS


(Clear to Send) frame. The CTS
frame contains the data length
(copied from the RTS frame).

* Upon receipt of the CTS frame,


A begins transmission.

* However, because both Band C are within the range of A, the CTS message, which
contains the duration of data transmission from B to A reaches C.

* Station C knows that some hidden station is using the channel and refrains from
transmitting until that duration is over.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 99


ii). Exposed station problem:

* In this problem a station refrains


from using a channel when it is, in
fact, available.

* A sends to B, C wants to send to


another terminal (not A or B) outside
the range D.

* C senses the carrier and detects that the carrier is busy.

* Actually Station C can sent data to station D, without interfering with the transmission
from A to B.

* However, station C is exposed to transmission from A; it hears what A is sending and


thus refrains from sending.

* The handshaking messages RTS and CTS cannot help in this case.

* Station C, after hearing the RTS from A, can wait for a time, so that the CTS from B
reaches A;

* It then sends an RTS to D to show that it needs to communicate with D. Both


stations D and A may hear this RTS, but station A is in the sending state, not the
receiving state.

* Station D, however, responds with a CTS. The problem is here. If station A has
started sending its data, station C cannot hear the CTS from station D because of the
collision; it cannot send its data to D.

* It remains exposed until station A finishes sending its data as shown in the figure.

* Hidden terminals cause collisions, where as Exposed terminals causes unnecessary


delay.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 100


Services:

The 802.11 standard for wireless LAN support two types of services, Distribution services
and Station services. The distribution services manage the inter cell membership and
communication with the stations outside the cell, whereas the station services, manages the
intra cell communications within a single cell.

1. Distribution services:

* These five distribution services take care of mobile stations connecting to the base
station when they come into the cell area as well as detaching them from the base
station when they leave the cell.

i). Association. When the mobile station wants to associate with the base station, it has to
broadcasts its identity details and authenticate itself.

ii). Disassociation. When the base station or mobile station wants to disassociate they have to
first inform the other using this service.

iii). Reassociation. When the mobile station is moving from one cell to another and wants to
change the base station, it uses this service to get connected.

iv). Distribution. Distribution is done by the base station. When it receives frames it checks
their address, if their destination is local it forwards over the air, if not it has to forwarded
through the wired network.

v). Integration. Integration is used to translate the frame format or address scheme when an
802.11 frame needs to send to another non-802.11 network.

2. Station services:

Once the mobile station is associated with the base station, then the four station services are
used.

i). Authentication. The base station sends a special frame to the mobile station. Mobile
station should respond with its secret code back to the base station. If the response is correct
base station allows it to enroll.

ii). Deauthentication. When mobile station wants to leave a deauthenticated service is


executed.

iii). Privacy. This service is used to encrypt and decrypt the information sent over a wireless
LAN.

iv). Data delivery. This service doesn’t provide any guarantee to the data delivered. 802.11 is
based on Ethernet, which is unreliable. Any error detection and corrections should be taken
care by higher layers.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 101


Physical Layer:

* All implementations, except the infrared, operate in the industrial, scientific and
medical (ISM) band, which defines three unlicensed bands in the three ranges. 902-
928 MHz, 2.400-4.835 GHz, and 5.725-5.850 GHz.

IEEE 802.11 FHSS: IEEE 802.11 FHSS uses the frequency-hopping spread spectrum (FHSS)
method. FHSS uses the 2.4-GHz ISM band. The band is divided into 79 sub
bands of 1 MHz (and some guard bands).

IEEE 802.11 DSSS: IEEE 802.11 DSSS uses the direct sequence spread spectrum (DSSS)
method. DSSS uses the 2.4-GHz ISM band.

IEEE 802.11 Infrared: IEEE 802.11 infrared uses infrared light in the range of 800 to 950 nm.
The modulation technique is called pulse position modulation (PPM).

IEEE 802.11a OFDM: IEEE 802.11a OFDM describes the orthogonal frequency-division
multiplexing (OFDM) is similar to FDM, with one major difference: All the
sub bands are used by one source at a given time.

IEEE 802.11b DSSS: IEEE 802.11 b DSSS describes the high-rate direct sequence spread
spectrum (HRDSSS) method for signal generation in the 2.4-GHz ISM band.

IEEE 802.11g: This new specification defines forward error correction and OFDM using the
2.4-GHz ISM band.

* The modulation technique achieves a 22 or 54 Mbps data rate. It is a backward


compatible with 802.11b, but the modulation technique is OFDM.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 102


Bluetooth (IEEE 802.15):

* Bluetooth is a wireless LAN technology designed to connect devices like telephones,


notebooks, computers, cameras, printers, coffee makers etc.

* A Bluetooth LAN is an adhoc network, which means that the network is formed
spontaneously.

Architecture:

Bluetooth defines two types of networks: 1. Piconet and 2. Scatternet.

i). Piconets.

* A Bluetooth network is called a


piconet or a small net.

* A piconet can have up to eight


stations. In which only one
station can be primary station the
rest are secondary stations.

* The communication between the primary and the secondary can be one-to-one or one-
to-many.

* Although a piconet can have a maximum of seven secondaries, an additional eight


secondaries can be in the parked state.

* A secondary in a parked state cannot become active and take part in communication,
until one of the active station out of the eight stations go to parked state.

ii). Scatternet.

* Piconets can be
combined to form what is
called a scatternet.

* A secondary station in
one piconet can be the
primary in another
piconet.

* This station can receive messages from the primary in the first piconet (as a
secondary) and, acting as a primary, deliver them to secondaries in the second
piconet.

* A station can be a member of two piconets.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 103


Bluetooth Protocol Stack (Layers):

* The Bluetooth standard has many protocols grouped loosely into layers. The layer
structure does not follow the OSI model, the TCP/IP model, the 802 model.

i). Radio Layer.

* The radio layer is equivalent to the physical layer of the Internet model.

* Bluetooth devices are low-


power and have a range of
10m.

* Bluetooth uses a 2.4-GHz ISM


band divided into 79 channels
of 1 MHz each.

* Bluetooth uses the frequency-


hopping spread spectrum (FHSS) method in the physical layer to avoid interference
from other devices or other networks.

* Bluetooth hops 1600 times per second, which means that each device changes its
modulation frequency 1600 times per second. Dwell time = (1/1600) = 625µs.

* Bluetooth uses a sophisticated version of FSK, called GFSK (Gaussian FSK)

ii). Baseband Layer.

* The baseband layer is roughly equivalent to the MAC sublayer in LANs. The access
method is TDMA. The primary and secondary communicate with each other using
time slots.

* The length of a time slot is exactly the same as the dwell time, 625 µs.

* During the time that one frequency is used, a sender sends a frame to a secondary, or
a secondary sends a frame to the primary.

* The communication is only between the primary and a secondary; secondary’s cannot
communicate directly with one another.

a). Physical Links :

* Bluetooth uses a form of TDMA that is called TDD-TDMA (timedivision duplex


TDMA) a kind of half-duplex communication.

* Two types of links can be created between a primary and a secondary: SCO links and
ACL links.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 104


SCO : A synchronous connection-oriented (SCO) link is used when avoiding latency is more
important than integrity for example real time audio applications.

* A physical link is created by reserving specific slots at regular intervals. One for each
direction. If a packet is damaged, it is never retransmitted.

ACL : An asynchronous connectionless link (ACL) is used when data integrity is


moreimportant than avoiding latency. If frame is corrupted, it is retransmitted.

iii). L2CAP

* The Logical Link Control and Adaptation Protocol, or L2CAP (L2 here means LL), is
roughly equivalent to the LLC sublayer in LANs.

* It is used for data exchange on an ACL link; SCO channels do not use L2CAP.
Below figure shows the format of the data packet at this level.

* Length: The I6-bit length field defines the size of the data, in bytes, coming
from the upper layers. Data can be up to 65,535 bytes.

* Channel ID: The channel ID


(CID) defines a unique identifier
for the virtual channel created at
this level.

* The L2CAP has specific duties: multiplexing, segmentation and reassembly, quality
of service (QoS), and group management.

a). Multiplexing : The L2CAP can multiplex the data at the sender side extracts the data
from the frame at the receivers side

b). Segmentation and Reassembly

* The maximum size of the payload field in the baseband layer is 2774 bits, or 343
bytes including 4 bytes to define the packet and packet length.

* When the packet length is more (Ex: Internet packet of 65,535 bytes), the L2CAP
divides these packets into segments and reassembles them at the destination.

c). QoS : Bluetooth allows the stations to define a quality-of-service level.

d). Group Management

* L2CAP allows devices to create a type of logical addressing between themselves.


This is similar to multicasting.

* For example, two or three secondary devices can be part of a multicast group to
receive data from the primary.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 105


Frame Structure:

A frame in the baseband layer can be one of three types: one-slot, three-slot, or five-slot as
shown in the below figure..

* Access code: This 72-bit field contains synchronization bits and the identifier of the
primary to distinguish the frame of one piconet from another.

Header:

* This 54-bit field is a repeated (three identical) 18-bit pattern. The receiver compares
these three sections, bit by bit.

* If each of the corresponding bits is the same, the bit is accepted; if not, the majority
opinion rules. This is a form of forward error correction (for the header only). Note
that there is no retransmission, in this sublayer. Each pattern has the following
subfields:

1. Address: The 3-bit address subfield can define up to seven secondaries (l to 7).
If the address is zero, it is used for broadcast communication from the primary
to all secondaries.

2. Type: The 4-bit type subfield defines the type of data coming from the upper layers.

3. F. This subfield is for flow control. When set (1), it indicates that the device
is unable to receive more frames (buffer is full).

4. A. This 1-bit subfield is for acknowledgment. Bluetooth uses Stop-and-Wait


ARQ;

5. S. This 1-bit subfield holds a sequence number.

6. HEC. The 8-bit header error correction subfield is a checksum to detect errors in
each 18-bit header section.

Payload: This subfield can be 0 to 2740 bits long. It contains data or control information
coming from the upper layers.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 106


Data Link Layer Switching:

Bridges:

* A bridge operates in both the physical and the data link layer. As a physical layer
device, it regenerates the signal it receives.

* As a data link layer device, the bridge can check the physical (MAC) addresses
(source and destination) contained in the frame.

* A bridge has
filtering capability.

* It can check the


destination address of a
frame and decide if the
frame should be
forwarded or dropped.

* If the frame is to be forwarded, the decision must specify the port. A bridge has a
table that maps addresses to ports.

Types of Bridges: 1. Transparent Bridges


2. Source Routing Bridges
3. Spanning tree bridges
4. Remote Bridges

i). Transparent Bridges

* A transparent bridge is a bridge in which the stations are completely unaware of the
bridge's existence.

* If a bridge is added or deleted from the system, reconfiguration of the stations is


unnecessary. Transparent bridges must meet three criteria:

i). Forwarding : A transparent bridge must correctly forward the frames.

ii). Learning : Bridges set the tables dynamically and maps addresses to ports
automatically. Bridges gradually learns from the frame movements.

* When station A sends a frame to station D, the frame goes (floods) out from all three
ports. However, by looking at the source address, the bridge learns that station A
must be located on the LAN connected to port 1. The bridge adds this entry to its
table.

* When station E sends a frame to station A, the bridge has an entry for A, so it
forwards the frame only to port 1. There is no flooding. In addition, it uses the source
address of the frame, E, to add a second entry to the table.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 107


* When station B sends a frame to C, the bridge has no entry for C, so once again it
floods the network and adds one more entry to the table. The process of learning
continues as the bridge forwards frames.

Loop Problems in Bridges:

* If redundant bridges (more than one bridge) are used, It can create loops in the
system, which is very undesirable, as shown in the below figure.

a). Station A
sends a frame to
station D. Both
forward the frame
and update their
tables based on the
source address A.

Now there are two


copies of the
frame on LAN2.

b). The copy


sent out by bridge
1 is received by
bridge 2, it floods
the bridge.

The copy sent out by bridge 2 is received by bridge 1 and is sent out for lack of information
about D.

* Each frame is handled separately because bridges, as two nodes on a network sharing
the medium, use an access method such as CSMA/CD. The tables of both bridges are
updated, but still there is no information for destination D.

c). Now there are two copies of the frame on LAN 1. Step 2 is repeated, and both copies
flood the network.

d). The process continues on and on. Note that bridges are also repeaters and regenerate
frames. So in each iteration, there are newly generated fresh copies of the frames.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 108


ii). Source Routing Bridges:

* One way to prevent loops in a system with redundant bridges is to use source routing
bridges. In source routing, a sending station includes the addresses of bridges through
which the frame have to pass.

* In other words, the frame contains not only the source and destination addresses, but
also the addresses of all bridges to be visited.

* The source gets these bridge addresses through the exchange of special frames with
the destination prior to sending the data frame.

* Source routing bridges were designed by IEEE to be used with Token Ring LANs.

iii). Spanning tree bridges (802.1D):

* To increase reliability, some sites use two or more bridges in parallel between pairs of
LANs. This arrangement creates loops in the topology.

* The solution to this difficulty is for the bridges to communicate with each other and
overlay the actual topology with a spanning tree that reaches every LAN. For
example, in the below figure, we see nine LANs interconnected by ten bridges.

* An arc connects any two LANs that are connected by a bridge. The graph can be
reduced to a spanning tree by dropping the arcs shown as dotted lines in fig b.

* Using this spanning


tree, there is exactly
one path from every
LAN to every other
LAN.

* Once the bridges have


agreed on the spanning
tree, all forwarding
between LANs follows
the spanning tree.

* Since there is a unique path from each source to each destination, loops are
impossible.To build the spanning tree, first the bridges have to choose one bridge to
be the root of the tree.

* They make this choice by having each one broadcast its unique serial number,
installed by the manufacturer. The bridge with the lowest serial number becomes the
root. Next, a tree of shortest paths from the root to every bridge and LAN is
constructed. This tree is the spanning tree.

* If a bridge or LAN fails, a new one is computed. It is standardized in IEEE 802.1D.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 109


iv). Remote Bridges:

* A common use of bridges is to connect two (or more) distant LANs. For example, a
company might have plants in several cities, each with its own LAN. Ideally, all the
LANs should be interconnected, so the complete system acts like one large LAN.

* This goal can be achieved by putting a bridge on each LAN and connecting the
bridges pairwise with point-to-point lines (e.g., leased lines) as shown in the fig.

* Various protocols can


be used on the point-to-
point lines.

* One possibility is to
choose some standard
point-to-point data link
protocol such as PPP, putting complete MAC frames in the payload field. This
strategy works best if all the LANs are identical.

* Another option is to strip off the MAC header and trailer at the source bridge and put
what is left in the payload field of the point-to-point protocol.

* A new MAC header and trailer can then be generated at the destination bridge. A
disadvantage of this approach is that the checksum that arrives at the destination
host is not the one computed by the source host, so errors caused by bad bits in a
bridge's memory may not be detected.

Advantages of using Bridges:

* Bridges have two effects on an Ethernet LAN: They raise the bandwidth and they
separate collision domains.

1. Raising the Bandwidth: In a un-bridged Ethernet network, the total capacity is shared
between all stations.

* By dividing the network using bridging, each network becomes independent. For
example, If a network with 12 stations and with 10 Mbps bandwidth is divided into
two networks, each network with 6 stations can get10 Mbps.

2. Separating Collision Domains:

* Another advantage of a bridge is the separation of the collision domain. Without


bridging, 12 stations contend for access to the medium; with bridging (shown below)
only 3 stations contend for access to the medium.

* This drastically reduces the collision domain and the probability of collision is
reduced tremendously.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 110


Local Internetworking.

* The bridges are completely transparent and accepts every frame transmitted on all the
LANs to which it is attached.

* Let us consider the below example. Bridge B1 is connected to LANs 1 and 2, and
bridge B2 is connected to LANs 2, 3, and 4.

* A frame arriving at bridge B1 on LAN 1 destined for A can be discarded immediately,


because it is already on the correct LAN, but a frame arriving on LAN 1 for C or F
must be forwarded.

Fig: A configuration with four LANs and two bridges.

* When a frame arrives, a


bridge must decide whether
to discard or forward it.
This decision is made by
looking into the destination
table inside the
bridge.

* Periodically, a process in the bridge scans the hash table and purges all entries more
than a few minutes old. In this way, if a computer is unplugged and plugged in again
somewhere else, within a few minutes it will be back in normal operation.

* The routing procedure for an incoming frame depends on the LAN it arrives at (the
source LAN) and the LAN its destination is on (the destination LAN), as follows:

1. If destination and source LANs are the same, discard the frame.

2. If the destination and source LANs are different, forward the frame.

3. If the destination LAN is unknown, use flooding.

Layer wise Networking /Internetworking Devices:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 111


Networking /Internetworking Devices.

i). Passive Hubs:

* A passive hub is a device where the wires coming from different branches are
connected. There is no amplification of the signal, it just acts as a central point to
connect wires.

* In a star-topology Ethernet LAN, a passive hub is just a point where the signals
coming from different stations collide; the hub is the collision point.

ii). Repeaters:

* While travelling through a medium, signals tend to lose their strength known as
attenuation. The signal gets corrupted after a certain distance as shown in the fig. So
to regenerate the signals, repeaters are used.

* A repeater is a device that operates in the physical layer. A repeater receives a


signal and regenerates the original bit pattern. Repeaters are used to extend the
physical length of a LAN.

* A repeater forwards every frame; it has no filtering capability. It is a


regenerator, not an amplifier.

iii). Layer 2 Switch or Bridge:

* Switches are similar to bridges, both routes on frame addresses. Unlike bridge
switches are most often used to connect individual computers, as shown in fig C.

* As a consequence, when host A in (fig b) wants to send a frame to host B, the bridge
gets the frame but just discards it.

* In contrast, in (fig c) the switch must actively forward the frame from A to B
because there is no other way for the frame to get there.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 112


* Since each switch port is connected to a single computer. Each port provides
buffer space for frames arriving at its ports. Since each port is its own collision
domain, switches never lose frames to collisions.

* However, if frames come in faster than they can be retransmitted, the switch may run
out of buffer space and have to start discarding frames.

* To alleviate (less severe) this problem slightly, modern switches start forwarding
frames as soon as the destination header field has come in, but before the rest of the
frame has arrived.

* These switches do not use store-and-forward switching. Sometimes they are referred
to as cut-through switches.

iv). Router (Three-Layer Switches):

* A router is a layer 3 device that routes packets based on their logical addresses
(host-to-host addressing).

* A router normally connects LANs and WANs in the Internet and has a routing table
that is used for making decisions about the route.

* The routing tables are normally dynamic and are updated using routing protocols.

v). Gateway:

* The activities of a gateway are more complex than that of the router or switch as it
communicates using more than one protocol.

* A gateway is normally a computer that operates in all five layers of the Internet or
seven layers of OSI model.

* A gateway takes an application message, reads it, and interprets it. This means that it
can be used as a connecting device between two internetworks that use different
models.

* A gateway can translate information between different network data formats or


network architectures. It can translate TCP/IP to AppleTalk so computers supporting
TCP/IP can communicate with Apple brand computers.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 113


Virtual LANs (802.1Q):

* The whole idea of VLAN technology is to divide a LAN into logical, instead of
physical segments.

* A LAN can be divided into several logical LANs called VLANs. Each VLAN is a
work group in the organization.

* If a person moves from one group to another, there is no need to change the physical
configuration. The group membership in VLANs is defined by software, not
hardware.

* Any station can be logically moved to another VLAN. All members belonging to a
VLAN can receive broadcast messages sent to that particular VLAN.

* VLAN technology even allows the grouping of stations connected to different


switches in a VLAN.

* Above figure shows a backbone local area network with two switches and three
VLANs. Stations from switches A and B belong to each VLAN.

i). VLANs create broadcast domains:

* VLANs group stations belonging to one or more physical LANs into broadcast
domains.

* The stations in a VLAN communicate with one another as though they belonged to a
physical segment.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 114


ii). Membership :

* Vendors use different characteristics such as port numbers, MAC addresses, IP


addresses, IP multicast addresses, or a combination of two or more of these.

iii). Configuration : Stations are configured in one of three ways:

1. Manual Configuration: The network administrator uses the VLAN software to manually
assign the stations into different VLANs at setup. Later migration from one VLAN to another
is also done manually.

2. Automatic Configuration: In an automatic configuration, the stations are automatically


connected or disconnected from a VLAN using criteria defined by the administrator.

For example, the administrator can define the project number as the criterion for being a
member of a group. When a user changes the project, he or she automatically migrates to a
new VLAN.

3. Semiautomatic Configuration: A semiautomatic configuration is somewhere between a


manual configuration and an automatic configuration. Usually, the initializing is done
manually, with migrations done automatically.

iv). Communication Between Switches:

* In a multi-switched backbone, each switch must know to which station belongs to


which VLAN, and the membership of stations connected to other switches. Three
methods have been devised for this purpose:

i). Table Maintenance: In this method, when a station sends a broadcast frame to its group
members, the switch creates an entry in a table and records station membership. The
switches send their tables to one another periodically for updating.

ii). Frame Tagging: In this method, when a frame is traveling between switches, an extra
header is added to the MAC frame to define the destination VLAN. This is used by the
receiving switches to determine the VLANs to be receiving the broadcast message.

iii). Time-Division Multiplexing (TDM):

* In this method, the connection (trunk) between switches is divided into timeshared
channels. For example, if the total number of VLANs in a backbone is five, each
trunk is divided into five channels.

* The traffic destined for VLAN 1 travels in channel l, the traffic destined for VLAN 2
travels in channel 2, and so on.

* The receiving switch determines the destination VLAN by checking the channel from
which the frame arrived.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 115


Advantages:

There are several advantages to using VLANs.

1. Cost and Time Reduction

* VLANs can reduce the migration cost of stations going from one group to another.

* Physical reconfiguration takes time and is costly. Instead of physically moving one
station to another segment or even to another switch, it is much easier and quicker to
move it by using software.

2. Creating Virtual Work Groups

* VLANs can be used to create virtual work groups.

* For example, in a campus environment, professors working on the same project can
send broadcast messages to one another without the necessity of belonging to the
same department.

* This can reduce traffic if the multicasting capability of IP was previously used.

3. Security

* VLANs provide an extra measure of security.

* People belonging to the same group can send broadcast messages with the guaranteed
assurance that users in other groups will not receive these messages.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 116


6. NETWORK LAYER

Network Layer Design Issues:

The important services provided by the network layer are:

1. Connection Oriented (CO) service (Virtual circuit)


2. Connectionless (CL) service (Datagram).

Example, The Internet offers connectionless network-layer service; ATM networks offer
connection-oriented network-layer service.

i). Connection Oriented Service:

* In connection-oriented service there are three phases.

i). Connection setup: Path establishment between the source and the destination
routers. This connection is called a VC (virtual circuit).
ii). Data transfer.
iii).Termination of the established path

Implementation of connection oriented service:

* Connection-oriented service uses a virtual-circuit. The virtual circuit is established by


storing the addresses of intermediate nodes (routers) route tables between the
source and the destination machines.

* The same route is used for all traffic flowing over the connection. Once the data
transfer is completed the connection is released, the virtual circuit is also terminated.

* With a connection-oriented service, each packet carries an identifier telling which


virtual circuit it belongs to. The below figure illustrates this.

* There are two virtual circuits using almost the same path H1 to H2 and H3 to H2.

The routers can distinguish the data


packets basing on their identifiers
from where they are coming from.

For this reason, ‘A’ assigns a


different connection dentifier to
the outgoing traffic for the second
connection.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 117


ii). Connectionless Service:

* In connectionless service, packets are injected into the subnet individually and routed
independently of each other.

* No advance setup is needed. In this context, the packets are frequently called
datagrams (in analogy with telegrams) and the subnet is called a datagram subnet.

Implementation of Connectionless Service:

* The below figure illustrates the connectionless service. Process P1 sending a long
message to process P2. This long message is four times longer than the maximum
packet size, so the network layer has to break it into four packets, 1, 2, 3, and 4 and
sends each of them in turn to router A.

Every router has an


internal table (which
is updated frequently)
which specifies the
shortest route for each
possible destination.

Each table entry is a


pair consisting of a
destination and the
outgoing line to use
for that destination.

For example, Router


A has only two
outgoing lines for B
and C, so every
incoming packet must
be sent to one of these routers.

* A's initial routing table is shown in the figure under the label ''initially.'' As they
arrived at A, packets 1, 2, and 3 were stored briefly (to verify their checksums). Then
each was forwarded to C according to A's table. Packet 1 was then forwarded to E and
then to F.

* The router A - may not follow to the initial table entries, it can change or update its
table entries any time basing on the information it gets from other routers.

* For example the packet 4 is supposed to travel through router C as per its initial table.
But the router A learned of a traffic jam somewhere along the ACE path and updated
its routing table, as shown under the label ''later.''

* The algorithm that manages the tables and makes the routing decisions is called the
routing algorithm.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 118


Difference between Virtual-Circuit and Datagram Subnets:

i). Virtual circuits allow packets to contain circuit numbers instead of full destination
addresses.

* If the packets tend to be fairly short, a full destination address in every packet may
represent a significant amount of overhead and hence, wasted bandwidth.

ii). Using virtual circuits requires a setup phase, which takes time and consumes resources.

* In a datagram subnet, there is no such setup phase.

iii). A datagram subnet needs to have an entry for every possible destination, whereas a
virtual-circuit subnet just needs an entry for each virtual circuit.

iv). Virtual circuits guarantee quality of service and avoid congestion within the subnet,
because resources are reserved in advance, when the connection is established.

* With a datagram subnet, congestion avoidance is more difficult.

v). For transaction processing systems (e.g., stores calling up to verify credit card purchases),
the overhead required to set up and clear a virtual circuit may take more time than the data
transfer time.

vi). Virtual circuits also have a vulnerability problem. If a router crashes and loses its
memory, all the virtual circuits passing through it will have to be aborted.

* In contrast, if a datagram router goes down, only those users whose packets were
queued in the router at the time will suffer, and maybe not even all those, depending
upon whether they have already been acknowledged.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 119


Routing Algorithms

* The main function of the network layer is to route packets from the source machine to
the destination machine.

* In most subnets, packets will require multiple hops to make the journey.

* The routing algorithm is the network layer software responsible for deciding which
output line an incoming packet should be transmitted on.

Routing algorithms can be grouped into two major classes: non-adaptive and adaptive.

i). Non-adaptive (Static routing) algorithms: Here the choice of the route is computed in
advance, off-line, and downloaded to the routers when the network is booted. This procedure
is also called static routing. (Ex: shortest path - Dijkstra, flooding).

ii). Adaptive (Dynamic routing) algorithms: Change their routing decisions to reflect
changes in the topology, and usually the traffic as well. This procedure is also called
Dynamic routing. (Ex: DVR, LSR).

The Optimality Principle

* Optimality principle is about optimal routes without regard to network topology or


traffic. It states that if router C is on the optimal path from router A to router B, then
the optimal path from C to B also falls along the same route.

Sink tree

* Sink tree is a tree where the set of optimal routes from all sources to a given
destination form a tree rooted at the destination. The distance metric is the number of
hops. The goal of all routing algorithms is to discover and use the sink trees for all
routers.

Figure (a) A subnet. (b) A sink tree for router B.

* The routers may


individually acquire the
information by
computation or by
collecting by some other
means.

* The optimality
principle and the sink
tree provide a benchmark
against which other routing algorithms can be measured.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 120


1. Non-adaptive (Static routing) algorithms.

Shortest Path Routing.

* In shortest Path Routing each node of a graph represents a router and each arc of the
graph represents a communication line (often called a link).

* To choose a route between a given pair of routers, the algorithm just finds the shortest
path between them on the graph.

* One way of measuring path length is the number of hops. Using this metric, the paths
ABC and ABE (in fig) are equally long.

* Another metric is the geographic distance in kilometers, in which case ABC is clearly
much longer than ABE (assuming the figure is drawn to scale).

* By changing the weighting function, the algorithm would then compute the ''shortest''
path measured according to any one of a number of criteria or to a combination of
criteria.

a). Dijkstra Algorithm:

* The Dijkstra algorithm calculates the shortest path between two points on a network,
using a graph made up of nodes and edges.
* The algorithm divides the nodes into two sets: tentative and permanent. It chooses
nodes, makes them tentative, examines them, and if they pass the criteria, makes them
permanent.
We can informally define the algorithm using the following steps:
i). Start with the local node (router): the root of the tree
ii). Assign a cost of 0 to this node and make it the first permanent node.
iii). Examine each neighbor node of the node that was the last permanent node

iv). Assign a cumulative cost to each node and make it tentative


v). Among the list of tentative nodes
- Find the node with the smallest cumulative cost and make it permanent
- If a node can be reached from more than one direction,
- Select the direction with the shortest cumulative cost
vi). Repeal steps 3 to 5 until every node becomes permanent.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 121


* The below fig A show some steps of the Dijkstra algorithm applied to node A of our
sample internet in Fig B. The number next to each node represents the cumulative
cost from the root node.

* Note that if a network can be reached through two directions with two cumulative
costs, the direction with the smaller cumulative cost is kept, and the other one is
deleted.

Routing table for node A

Flooding vs Broadcast.

Flooding: Broadcast:

Flooding sends all incoming packets through Broadcasting is done by specifying a special
every outgoing edge. broadcast address on packets.

Flooding may send the same packet along the Broadcasting sends a packet along a link at
same link multiple times. most once.

Several copies of the same packet may reach Broadcasting does not cause that problem.
nodes in flooding.

Flooding is a type of broadcast in order to Broadcast is simply broadcast to all ports but
learn or get some thing, like switch does to not intended to get some result like MAC
learn destination MAC address when it address.
receives frame for unknown MAC address.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 122


b). Flooding.

* Flooding is a static algorithm, in which every incoming packet is sent out on every
outgoing line except the one it arrived on.

Advantages:

* Flooding algorithm is guaranteed to find and utilize the shortest path for sending
packets because it naturally uses every path in the network.

* There are no complexities in this routing algorithm; it is very easy to implement.

Disadvantages:

* Flooding generates vast numbers of duplicate packets, in fact, an infinite number


unless some measures are taken to damp the process.

Measures to control flooding:

* One measure is to have a hop counter, which is decremented at each hop, when the
counter reaches zero the packet being discarded.

* Another possible precaution is to ask nodes to track each packet passing through it
and make sure that a packet goes through it only once.

* In selective flooding the routers do not send every incoming packet out on every line,
only on those lines that are going approximately in the right direction.

Flooding Applications:

i). In military applications, where large numbers of routers may be blown to bits at any
instant, the tremendous robustness of flooding is highly desirable.

ii). In a distributed database applications, it is sometimes necessary to update all the


databases concurrently, in which case flooding can be useful.

iii). In wireless networks, all messages transmitted by a station can be received by all
other stations within its radio range.

iv). Flooding can be used as a metric against which other routing algorithms can be
compared.

v). Flooding always chooses the shortest path because it chooses every possible path in
parallel.

vi). Usenet and p2p (peer-to-peer) systems use flooding. Furthermore, routing protocols
like OSPF, DVMRP and ad-hoc wireless networks use flooding.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 123


Reverse path forwarding

* RPF is a modified flooding strategy. To prevent loops, only one copy is forwarded;
the other copies are dropped. In RPF, a router forwards only the copy that has
traveled the shortest path from the source to the router.

* The router receives a packet, and extracts the source address (a unicast address). It
consults its unicast routing table as though it wants to send a packet to the source
address.

* If it arrived from the hop as defined in the table, the packet has traveled the shortest
path, so the router forwards the packet if not the packet is discarded.

* This strategy prevents loops because there is always one shortest path from the source
to the router. If a packet leaves the router and comes back again, it has not traveled
the shortest path.

* An example of reverse path forwarding is shown below. On the first hop, I send
packets to F, H, J, and N, as indicated by the second row of the tree.

* Each of these packets arrives on the preferred path to I (assuming that the preferred
path falls along the sink tree) and is so indicated by a circle around the letter.

* On the second hop, eight packets are generated, two of each of the routers that
received a packet on the first hop. As it turns out, all eight of these arrive at
previously unvisited routers, and five of these arrive along the preferred line.

Fig (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding

* Of the six packets generated on the third hop, only three arrive on the preferred path
(at C, E, and K); the others are duplicates.

* After five hops and 24 packets, the broadcasting terminates, compared with four hops
and 14 packets had the sink tree has been followed exactly.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 124


2. Adaptive (Dynamic routing) algorithms.

a). Distance Vector Routing

* Distance vector routing algorithm is also known as the distributed Bellman-Ford


routing algorithm and the Ford-Fulkerson algorithm)

* In distance vector routing, the least-cost route between any two nodes is the route
with minimum distance. In this protocol, each node maintains a vector (table) of
minimum distances to every node.

* Each node shares and updates its routing table by exchanging information with its
immediate neighbors periodically and when there is a change.

* The table for node A shows how we can reach any node from this node. For example,
Our least cost to reach node E is 6. The route passes through C.

i). Initialization: Initially the node can know only the distance between itself and its
immediate neighbors, those directly connected to it. So for the moment, we assume that each
node can send a message to the immediate neighbors and find the distance between itself and
their neighbors. The distance for any entry that is not a neighbor is marked as infinite
(unreachable).

ii). Sharing: The routing table information of every node is shared between their
neighbors. For example, node A does not know about node E, node C does. So if node C
shares its routing table with A, node A can also know how to reach node E.

iii). Updating: The routing tables of each node are updated frequently by sharing the
information with their neighbors.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 125


The Count-to-Infinity Problem

* One of the major drawbacks in distance vector routing is Count-To-Infinity


Problem.

* Below Figure with three nodes illustrates this problem. At the beginning, both nodes
A and B know how to reach node X. But suddenly, the link between A and X fails.

* Node A changes its table. If A can send its table to B immediately, everything is fine.
However, the system becomes unstable if B sends its routing table to A before
receiving A's routing table.

* Node A receives the update and, assuming that B has found a way to reach X,
immediately updates its routing table.

* Based on the triggered update strategy, A sends its newest update to B.

* Now B thinks that something has been changed around A and updates its routing
table. The cost of reaching X increases gradually until it reaches infinity.

* At this moment, both A and B know that X cannot be reached. However, during this
time the system is not stable.

* Node A thinks that the route to X is via B; node B thinks that the route to X is via
A.

* If A receives a packet destined for X, it goes to B and then comes back to A.


Similarly, if B receives a packet destined for X, it goes to A and comes back to B.

* Packets bounce between A and B, creating a two-node loop problem. A few solutions
have been proposed for instability of this kind.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 126


Solutions for count to infinity problem:

i). Defining Infinity:

* The first obvious solution is to redefine infinity to a smaller number. Most


implementations of the distance vector protocol define the distance between each
node to be 1 and define 16 as infinity.

* However, this means that the distance vector routing cannot be used in large systems.
The size of the network, in each direction, cannot exceed 15 hops.

ii). Split Horizon:

* In this strategy, instead of sending the total table, each node sends only part of its
table through each interface.

* If node B thinks that the optimum route to reach X is via A, it does not need to
advertise this piece of information to A, because the information has come from A

* Taking information from node A, modifying it, and sending it back to node A creates
the confusion.

* In this case, node A keeps the value of infinity as the distance of X. Later, when node
A sends its routing table to B, node B also corrects its routing table.

* The system becomes stable after the first update: both node A and B know that X is
not reachable.

iii). Split Horizon and Poison Reverse.

* Using the split horizon strategy has one drawback. Normally, the distance vector
protocol uses a timer, and if there is no news about a route, the node deletes the route
from its table.

* When node B in the previous scenario eliminates the route to X from its
advertisement to A, node A cannot guess that this is due to the split horizon strategy
(the source of information was A) or because B has not received any news about X
recently.

* The split horizon strategy can be combined with the poison reverse strategy. Node B
can still advertise the value for X, but if the source of information is A, it can replace
the distance to infinity as a warning: "Do not use this value; what I know about this
route comes from you.

* The two-node instability can be avoided by using the split horizon strategy combined
with poison reverse. However, if the instability is between three nodes, stability
cannot be guaranteed.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 127


b). Link State Routing:

The link state routing is simple and can be stated as five parts. Each router must do the
following:

i). Discover its neighbors and learn their network addresses.

ii). Measure the delay or cost to each of its neighbors.

iii). Construct a packet, telling all it has just learned.

iv). Send this packet to all other routers.

v). Compute the shortest path to every other router.

Building Link state packets for a subnet:

The three keys to understand how this method works are as follows:

i). Sharing knowledge about the neighborhood:

* Each router sends the state of its neighborhood to every other router in the area.

ii). Sharing with every other router:

* Sharing is done by flooding, a process whereby a router sends its information to all its
neighbors (through all its output ports).

* Every router that receives the packet sends copies to each of its neighbors. Eventually,
every router (without exception) has received a copy of the same information.

iii). Sharing when there is a change:

* Each router share the state of its neighborhood only when there is a change.

(This rule contrasts with distance vector routing where information is sent out at regular
intervals regardless of change. This characteristic results in lower internet traffic than that
required by distance vector routing).

With link state routing, every router has the whole "picture" of the internet. Basing on this
information router can calculate the shortest path between itself and each network.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 128


Hierarchical Routing.

* As networks grow in size, the router routing tables grow proportionally. At a certain
point the network may grow to the point where it is no longer feasible for every outer
to have an entry for every other router, so the routing will have to be done
hierarchically, as it is in the telephone network.

* Example of routing in a two-level hierarchy with five regions. The full routing table
for router 1A has 17 entries, as shown in Fig. (b).

* When routing is done hierarchically, as in Fig (c), there are entries for all the local
routers as before, but all other regions have been condensed into a single router, so all
traffic for region 2 goes via the 1B2A line, but the rest of the remote traffic goes via
the 1C3B line.

* Hierarchical routing has reduced the table from 17 to 7 entries. As the ratio of the
number of regions to the number of routers per region grows, the savings in table
space increase.

* One disadvantage is increased path length. For example, the best route from 1A to 5C
is via region 2, but with hierarchical routing all traffic to region 5 goes via region 3,
because that is better for most destinations in region 5.

* When a single network becomes very large, an interesting question is: How many
levels should the hierarchy have? For example, consider a subnet with 720 routers.

* If there is no hierarchy, each router needs 720 routing table entries. If the subnet is
partitioned into 24 regions of 30 routers each, each router needs 30 local entries plus
23 remote entries for a total of 53 entries.

* If a three-level hierarchy is chosen, with eight clusters, each containing 9 regions of


10 routers, each router needs 10 entries for local routers, 8 entries for routing to other
regions within its own cluster, and 7 entries for distant clusters, for a total of 25
entries.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 129


Broadcast routing:

* Sending a packet to all destinations simultaneously is called broadcasting;

* Broadcasting makes sure that every device in the network will receive a (broadcasted)
packet. various methods have been proposed for broadcasting.

1. One broadcasting method is for the source to simply send a distinct packet to each
destination.

* Not only is the method wasteful of bandwidth, but it also requires the source to have a
complete list of all destinations.

2. Flooding is another method. Flooding sends all incoming packets through every
outgoing edge. It may send the same packet along the same link multiple times.

* The problem with flooding as a broadcast technique is it generates too many packets
and consumes too much bandwidth.

3. Multi-destination routing. In this method, each packet contains either a list of


destinations or a bit map indicating the desired destinations.

* Multi-destination routing is like separately addressed packets, which follow the same
route.

4. Spanning tree: Spanning tree makes explicit use of the sink tree for the router
initiating the broadcast or any other convenient spanning tree.

* A spanning tree is a subset of the subnet that includes all the routers but contains no
loops. This method makes excellent use of bandwidth.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 130


Multicast routing:

* Multicasting is a process of sending data packets to a large number of receivers


simultaneously. Ex: distributed databases, transmitting stock, etc. IP supports
multicasting, using class D addresses. Two kinds of group addresses are supported:
permanent addresses and temporary ones.

* A permanent group is always there and does not have to be set up. Temporary groups
must be created before they can be used.

* Multicasting requires group management. Some way is needed to create and destroy
groups, as well as the routers should know which of their hosts belong to which
groups. Multicasting uses the IGMP protocol.

* For this, each router computes a spanning tree covering all other routers. For example,
in Fig.(a) we have two groups, 1 and 2. Some routers are attached to hosts that belong
to one or both of these groups, as indicated in the figure.

Figure (a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for
group 1. (d) A multicast tree for group 2.

* When a process sends a multicast packet to a group, the first router examines its
spanning tree and prunes it, removing all lines that do not lead to hosts that are
members of the group.

* In our example, Fig.(c) shows the pruned spanning tree for group 1. Similarly, Fig. (d)
Shows the pruned spanning tree for group 2. Multicast packets are forwarded only
along the appropriate spanning tree.

* One potential disadvantage of this algorithm is that it scales poorly to large networks.

* Suppose that a network has n groups, each with an average of m members. For each
group, m pruned spanning trees must be stored, for a total of m n trees. When many
large groups exist, considerable storage is needed to store all the trees.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 131


Routing for Mobile hosts

Mobile hosts are two categories.

1. Migratory hosts are basically stationary hosts who move from one fixed site to another
from time to time, but use the network only when they are physically connected to it.

2. Roaming hosts actually compute on the run and want to maintain their connections as they
move around.

* All hosts are assumed to have a permanent home location that never changes.

* In the above model each area has one or more foreign agents, that keep track of all
mobile hosts visiting the area.

* Each area has a home agent, which keeps track of hosts whose home is in the area, but
who are currently visiting another area.

* When a new host enters an area it must register with the foreign agent there. The
registration procedure typically works like this:

* Periodically, each foreign agent broadcasts a packet announcing its existence and
address. A newly-arrived mobile can respond to these messages or the mobile host
can broadcast a packet saying: Are there any foreign agents around?

* The mobile host registers with the foreign agent, giving its home address, current data
link layer address, and some security information.

* The foreign agent contacts the mobile host's home agent by sending a message which
contains the foreign agent's network address and the security information of mobile
host.

* The home agent examines the security information, which contains a timestamp, to
prove that it was generated within the past few seconds. If it is happy, it tells the
foreign agent to proceed.

* When the foreign agent gets the acknowledgement from the home agent, it makes an
entry in its tables and informs the mobile host that it is now registered.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 132


Routing in Adhoc Networks

* Adhoc networks are created on demand. With an adhoc network, the topology may be
changing all the time, so desirability and even the validity of paths can change
spontaneously, without warning.

* These are also called as MANETs (Mobile Ad hoc NET works), used mainly in
Emergencies, Military vehicles on a battlefield with no existing infrastructure, etc. A
variety of routing algorithms for ad hoc networks have been proposed.

AODV (Ad hoc On-demand Distance Vector) routing algorithm:

* It is a distance vector algorithm adapted to work in a mobile environment. It is an on-


demand algorithm, that is, it determines a route to some destination only when
somebody wants to send a packet to that destination.

Route Discovery

* At any instant of time, an ad hoc network can be described by a graph of the nodes
(routers + hosts). For example, if node A wants to send a packet to node I.

* First node A looks in its table and does not find an entry for I. It now has to discover a
route to I. This property of discovering routes only when they are needed is what
makes this algorithm ''on demand.''

* To locate I, A constructs a special ROUTE REQUEST packet and broadcasts it. The
packet reaches B and D which are the only nodes connected to A.

* Neither B nor D knows where I is, so each of them creates a reverse route entry
pointing back to A, as shown by the arrows in Fig.(b), and broadcasts the packet with
Hop count set to 1.

* The broadcast from B reaches C and D. C makes an entry for it in its reverse route
table and rebroadcasts it.

* In contrast, D rejects it as a duplicate. Similarly, D's broadcast is rejected by B.


However, D's broadcast is accepted by F and G and stored, as shown in Fig.(c).

* After E, H, and I receive the broadcast, the ROUTE REQUEST finally reaches a
destination that knows where I is, namely, I itself, as illustrated in Fig.(d).

* Finally, node I responds with ROUTE REPLY and the data packets are forwarded
from A to I.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 133


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 134


7. CONGESTION CONTROL

Congestion Control Algorithms:

* Congestion is a situation, where too many packets are present in the subnet, and all
need the same output line.

* When the number of packets entering and leaving the subnet are proportional there
will be no problem. However, if the incoming packets are higher than delivered, then
the routers begin losing packets.

* At very high traffic, performance collapses completely and almost no packets are
delivered.

* This situation leads to congestion and degrades the network performance drastically.
The below figure illustrates this.

Reasons for congestion:

Congestion can be brought on by several factors.

i). Memory:

* When streams of packets begin arriving a queue will build up. If there is insufficient
memory to hold all of them, packets will be lost.

* Adding more memory may help up to a point, but infinite memory lead to duplicates
because time out frames are resented by the nodes and thus overloading all the way.

ii). Slow processors can also cause congestion.

* If the routers CPUs are slow at performing the tasks required of them (queuing
buffers, updating tables, etc.), queues can build up, even though there is excess line
capacity.

iii). Low-bandwidth lines.

* Low bandwidth can also cause congestion.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 135


General Principles of Congestion Control:

Congestion control can be taken care by dividing all solutions into two groups:

i). Open loop.


ii). Closed loop.

1. Open-loop control is designed to minimize congestion in the first place, this is done by
using appropriate policies at various levels include deciding when to accept new traffic and
when to discard packets and which ones, and making scheduling decisions at various points
in the network.

2. Closed loop solutions are based on the concept of a feedback loop. This approach has
three parts when applied to congestion control:

1. Monitor the system to detect when and where congestion occurs.


2. Pass this information to places where action can be taken.
3. Adjust system operation to correct the problem.

* A variety of metrics can be used to monitor the subnet for congestion. Chief among
these are the percentage of all packets discarded for lack of buffer space, the average
queue lengths, the number of packets that time out and are retransmitted, the average
packet delay. In all cases, rising numbers indicate growing congestion.

* The second step in the feedback loop is when the router detects the congestion it
sends a packet to the traffic source or sources, announcing the problem. These extra
packets increase the load, when the subnet is congested.

* Other possibilities also exist. For example, a bit or field can be reserved in every
packet for routers to fill in whenever congestion gets above some threshold level.
When a router detects this congested state, it fills in the field in all outgoing packets,
to warn the neighbors.

* Another approach is to have hosts or routers periodically send probe packets out to
explicitly ask about congestion. This information can then be used to route traffic
around problem areas.

* The closed loop algorithms are also divided into two subcategories: explicit feedback
versus implicit feedback.

In explicit feedback algorithms, packets are sent back from the point of congestion to warn
the source.

In implicit algorithms, the source deduces the existence of congestion by making local
observations, such as the time needed for acknowledgements to come back.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 136


Congestion Prevention Policies.

* Open loop systems are designed to minimize congestion in the first place, rather than
letting it happen and reacting after the fact. For this they use appropriate policies at
various levels.

* Below table shows data link, network, and transport policies that can affect
congestion.

i). In the data link layer:

* The retransmission policy is concerned with how fast a sender times out. If receivers
routinely discard all out-of-order packets, these packets will have to be transmitted
again later, creating extra load.

* With respect to congestion control, selective repeat is clearly better than go back N.

* The acknowledgement policy also affects congestion. If each packet is acknowledged


immediately, the acknowledgement packets generate extra traffic. A tight flow control
scheme (e.g., a small window) reduces the data rate and thus helps fight congestion.

ii). In the network layer:

* The choice between using virtual circuits and using datagrams affects congestion
since many congestion control algorithms work only with virtual-circuit subnets.

* Packet queuing and service policy relates to whether routers have one queue per input
line, one queue per output line, or both.

* It also relates to the order in which packets are processed. Discard policy is the rule
telling which packet is dropped when there is no space.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 137


* A good routing algorithm can help avoid congestion by spreading the traffic over all
the lines, whereas a bad one can send too much traffic over already congested lines.

* Finally, packet lifetime management deals with how long a packet may live before
being discarded. If it is too long, lost packets may clog up the works for a long time,
but if it is too short, packets may sometimes time out before reaching their
destination, thus inducing retransmissions.

iii). In the transport layer:

* The same issues occur as in the data link layer, but in addition, determining the
timeout interval is harder because the transit time across the network is less
predictable than the transit time over a wire between two routers.

* If the timeout interval is too short, extra packets will be sent unnecessarily. If it is too
long, congestion will be reduced, but the response time will suffer whenever a packet
is lost.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 138


Congestion Control in Virtual-Circuit Subnets

The congestion control methods described above are basically open loop. Here we look into
dynamically controlling congestion in virtual-circuit subnets.

Admission control.

* One technique that is widely used to keep congestion that has already started from
getting worse is admission control.

* The idea is simple: once congestion has been signaled, no more virtual circuits are set
up until the problem has gone away. (Like line engage signal in the telephone system).

* An alternative approach is to allow new virtual circuits carefully avoiding the problem
areas. For example, consider the subnet of the below Fig., in which two routers are
congested, as indicated.

(a) A congested subnet. (b) A redrawn subnet that eliminates the congestion.
A virtual circuit from A to B is also shown.

* Suppose that a host attached to router A wants to set up a connection to a host


attached to router B. Normally, this connection would pass through one of the
congested routers.

* To avoid this situation, we can redraw the subnet as shown in Fig.(b), omitting the
congested routers and all of their lines. The dashed line shows a possible route for the
virtual circuit that avoids the congested routers.

* Another strategy is to negotiate an agreement between the host and subnet prior
setting up a virtual circuit. In this case the subnet will reserve resources include a
table and buffer space in the routers and required bandwidth, thus avoiding any
congestion in future.

* The disadvantage of doing it all the time is that it tends to waste resources. For
example, If six virtual circuits that might use 1 Mbps all pass through the same
physical 6-Mbps line, the line has to be marked as full, even though it may rarely
happen that all six virtual circuits are transmitting full blast at the same time.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 139


Congestion Control in Datagram Subnets:

i). The Warning Bit:

* A special bit (warning bit) is set in the packet's header. When the packet arrived at its
destination, the transport entity copied the bit into the next acknowledgement sent
back to the source. The source then cut back on traffic.

* As long as the router was in the warning state, it continued to set the warning bit. The
source monitors the acknowledgement’s and if the (warning) bit is set, it reduces its
transmission rate if it is not set it increase its transmission rate.

ii). Choke Packets:

* In this approach, the router sends a choke packet back (the original packet is tagged
by turning the header bit on) to the source host. When the source (host) gets the choke
packet, it reduces the traffic.

* Wait for a fixed time interval and listens for more choke packets for another interval.

* If one arrives, the line is still congested, so the host reduces the flow still more. This
process continues.

* Once the choke packets are stopped the host may increase the flow again.

iii). Load Shedding:

* When none of the above methods make the congestion disappear, routers can use load
shedding.

* Load shedding is a way of dropping the packets, when routers are being flood by
packets that they cannot handle.

iv). Random Early Detection (RED):

* Once the congestion is first detected it will be effective if packets are discarded before
the total buffer space is exhausted.

* To do this, routers observe the average queue length if it exceeds a threshold, the line
is said to be congested and action is taken. A choke packet can be sent but this puts
even more load on the already congested network.

* A different strategy is to just discard the selected packet and not report it. Since the
source router knows that lost packets are generally caused by congestion and discards,
it will respond by slowing down instead of trying harder.

* In wireless networks, where most losses are due to noise on the air-link, this approach
cannot be used.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 140


Jitter Control:

* For applications such as audio and video streaming the transit time should be
constant. The variation (i.e., standard deviation) in the packet arrival times is called
jitter.

* High jitter, for example, having some packets taking 20 milliseconds and others
taking 30 msec to arrive will give an uneven quality to the sound or movie. Jitter is
illustrated in the below Fig.

Figure (a) High jitter. (b) Low jitter.

The jitter can be bounded by computing the expected transit time for each hop along the path.

* When a packet arrives, the router checks to see how much the packet is behind or
ahead of its schedule. This information is stored in the packet and updated at each
hop.

* If the packet is ahead of schedule, it is held just long enough to get it back on
schedule.

* If it is behind schedule, the router tries to get it out the door quickly, in both cases
reducing the amount of jitter.

* In some applications, such as video on demand, jitter can be eliminated by buffering


at the receiver and then fetching data for display from the buffer instead of from the
network in real time.

* However, for other applications, especially those that require real-time interaction
between people such as Internet telephony and videoconferencing, the delay inherent
in buffering is not acceptable.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 141


Quality Of Service (QoS):

Quality of service (QoS) can be defined informally as a quality of service, something a flow
seeks to attain.

Flow Characteristics: Traditionally, four types of characteristics are attributed to a flow:

i). Reliability
ii). Delay
iii). Jitter
iv). Bandwidth.

i). Reliability

* Lack of reliability means losing a packet or acknowledgment. However, the


sensitivity of application programs to reliability is not the same.

* For example, it is more important that electronic mail, file transfer, and Internet
access have reliable transmissions than telephony or audio conferencing.

ii). Delay

* Source-to-destination delay is another flow characteristic. Again applications can


tolerate delay in different degrees.

* In this case, telephony, audio conferencing, video conferencing, and remote log-in
need minimum delay, while delay in file transfer or e-mail is less important.

iii). Jitter

* Jitter is defined as the variation in the packet delay. High jitter means the difference
between delays is large; low jitter means the variation is small.

* For example,

case: 1 if four packets depart at times 0, 1, 2, 3 and arrive at 20, 21, 22, 23, all have
the same delay (20 units of time).

case: 2 if the above four packets arrive at 21, 23, 21, and 28, they will have different
delays: 21,22, 19, and 24.

* For audio and video applications same delay (case 1) is acceptable, but variation in
delay (case 2) is not acceptable.

iv). Bandwidth

* Different applications need different bandwidths.

* In video conferencing we need to send millions of bits per second to refresh a color
screen, while the total number of bits in an e-mail may not reach even a million.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 142


Techniques to Improve QoS

* Commonly used methods to improve the quality of service are:

i). Buffering,
ii). Traffic shaping, a). leaky bucket
b). token bucket
iii). Admission control,
iv). Resource reservation.
v). Packet Scheduling

i). Buffering:

* Flows can be buffered on the receiving side before being delivered. Buffering
smooth’s out the jitter. For audio and video on demand, jitter is the main problem, so
this technique helps a lot. In the below figure, we see a stream of packets being
delivered with substantial jitter.

* Packet 1 is sent from the server at t = 0 sec and arrives at the client at t = 1 sec.

* Packet 2 undergoes more delay and takes 2 sec to arrive. As the packets arrive, they
are buffered on the client machine.

* At t = 10 sec, playback begins. At this time, packets 1 through 6 have been buffered
so that they can be removed from the buffer at uniform intervals for smooth play.

* Unfortunately, packet 8 has been delayed so much that it is not available when its play
slot comes up, so playback must stop until it arrives, creating a gap in the music or
movie.

* This problem can be alleviated by delaying the starting time even more, although
doing so also requires a larger buffer. Commercial Web sites that contain streaming
audio or video all use players that buffer for about 10 seconds before starting to play.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 143


ii). Traffic Shaping

* Traffic shaping is a mechanism to control the amount and the rate of the traffic sent to
the network. Two techniques can shape traffic: i). leaky bucket and ii). token bucket.

a). Leaky Bucket

* A water bucket with a small hole leaks water from the bucket at a constant bit rate.

* The input rate can vary, but the output rate remains constant. Similarly, in networking
bursty chunks are stored in the bucket and sent out at an average rate.

* A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging the
data rate. It may discard the packets if the bucket is full.

b). Token Bucket

* In leaky bucket method if a host is not sending for a while, its bucket becomes empty.
If the host has bursty data, the leaky bucket allows only an average rate. The
time when the host was idle is not taken into account.

* The token bucket algorithm allows idle hosts to accumulate credit for the future in the
form of tokens.

* For each tick of the clock, the system sends n tokens to the bucket. The system
removes one token for every cell (or byte) of data sent.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 144


* For example, if n is 100 and the host is idle for 100 ticks, the bucket collects 10,000
tokens. Now the host can consume all these tokens in one tick with 10,000 cells, or
the host takes 1000 ticks with 10 cells per tick.

In other words, the host can send bursty data as long as the bucket is not empty.

* Difference between the two algorithms is that the token bucket algorithm throws away
tokens when the bucket fills up but never discards packets. In contrast, the leaky
bucket algorithm discards packets when the bucket fills up.

Combining Token Bucket and Leaky Bucket

* The two techniques can be combined to credit an idle host and at the same time
regulate the traffic.

* The leaky bucket is applied after the token bucket; the rate of the leaky bucket needs
to be higher than the rate of tokens dropped in the bucket.

iii). Admission Control

* Admission control refers to the mechanism used by a router, or a switch, to accept or


reject a flow based on predefined parameters called flow specifications.

* Typically, the sender (e.g., the video server) produces a flow specification proposing
the parameters it would like to use. As the specification propagates along the route,
each router examines it and modifies the parameters as need be. When it gets to the
other end, the parameters can be established.

* Because many parties may be involved in the flow negotiation (the sender, the
receiver, and all the routers along the path between them), flows must be described
accurately in terms of specific parameters that can be negotiated. A set of such
parameters is called a flow specification.

* Before a router accepts a flow for processing, it checks the flow specifications to see
if its capacity (in terms of bandwidth, buffer size, CPU speed, etc.) and its previous
commitments to other flows can handle the new flow.

iv). Resource Reservation

* A flow of data needs resources such as a buffer, bandwidth, CPU time, and so on. The
quality of service is improved if these resources are reserved beforehand.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 145


v). Packet Scheduling:

Several scheduling techniques are designed to improve the quality of service. Some of them
are: i). FIFO queuing, ii). priority queuing, and iii). weighted fair queuing.

a). FIFO Queuing

* In first-in, first-out (FIFO) queuing method, the packets are stored in the buffer
(Queue) and the processor process on first come first basis.

* If the buffer is full newly arrived packets will be discarded.

b). Priority Queuing

* In priority queuing, packets are first assigned to a priority class. The packets in the
highest-priority queue are processed first, the low-priority queue are processed last.

* A priority queue can provide better QoS than the FIFO queue because higher priority
traffic, such as multimedia, can reach the destination with less delay.

* The potential drawback in this method is if there is a continuous flow in a high-


priority queue, the packets in the lower-priority queues will never have a chance to be
processed. This is a condition called starvation.

c). Weighted Fair Queuing

* In this technique, the queues are weighted based on the priority of the queues; higher
priority means a higher weight.

* The system processes packets in each queue in a round-robin fashion with the number
of packets selected from each queue based on the corresponding weight.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 146


* For example, if the weights are 3, 2, and 1, three packets are processed from the first
queue, two from the second queue, and one from the third queue.

* If the system does not impose priority on the classes, all weights can be equal.

Quality of service in the Internet:

i). Integrated Services


ii). Differentiated Services.

i). Integrated Services:

* In the Integrated Services model, an application program needs resource reservation.


At the IP level, we need to create a flow, a kind of virtual-circuit network.

* A virtual-circuit network uses Resource Reservation Protocol (RSVP) as a signaling


system which is designed for multicasting. It can be also used for unicasting.

* In RSVP, the receivers, not the sender, make the reservation. For example, in
multicast routing protocols, the receivers, not the sender, make a decision to join or
leave a multicast group.

RSVP Messages: RSVP has several types of messages. Two of them: Path and Resv.

a). Path Messages:

* In RSVP the receivers make the reservation. But the receivers do not know the path.
To solve this, RSVP uses Path messages.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 147


* A Path message travels from the sender and reaches all receivers in the multicast path.
On the way, a Path message stores the necessary information for the receivers. A new
message is created when the path diverges. The figure shows path messages.

b). Resv Messages:

* After a receiver has received a Path message, it sends a Resv message. The Resv
message travels toward the sender (upstream) and makes a resource reservation on the
routers that support RSVP.

Reservation Merging

* In RSVP, the resources are not reserved for each receiver in a flow; the reservation is
merged.

* In the figure, Rc3 requests a 2-Mbps bandwidth while Rc2 requests a 1-Mbps
bandwidth. Router R3, merges the two requests and the reservation is made for 2
Mbps, because a 2-Mbps input reservation can handle both requests.

* The same situation is true for R2. In a multimedia environment, different receivers
may handle different grades of quality.

Problems with Integrated Services:

* There are at least two problems with Integrated Services that may prevent its full
implementation in the Internet: scalability and service-type limitation.

i). Scalability : The Integrated Services model requires that each router keep the information
for each flow. As the Internet is growing every day, this is a serious problem.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 148


ii). Service-Type Limitation: The Integrated Services model provides only two types of
services, guaranteed and control-load. Those opposing this model, argue that applications
may need more than these two types of services.

Service Classes:

* Two classes of services have been defined for Integrated Services:


a). Guaranteed service and b). Controlled-load service.

a). Guaranteed Service Class: This type of service is designed for real-time traffic that
needs a guaranteed minimum end-to-end delay.

* The end-to-end delay is the sum of the delays in the routers, the propagation delay in
the media, and the setup mechanism.

b). Controlled-Load Service Class: This type of service is designed for applications that can
accept some delays, but are sensitive to an overloaded network and to the danger of losing
packets.

* Good examples of these types of applications are file transfer, e-mail, and Internet access.

ii). Differentiated Services.

* Differentiated Services (DS or Diffserv) is to handle the shortcomings of Integrated


Services. Two fundamental changes were made:

a). The main processing was moved from the core of the network to the edge of the network.
This solves the scalability problem.

* The routers do not have to store information about flows. The applications, or hosts,
define the type of service they need each time they send a packet.

b). The per-flow service is changed to per-class service. The router routes the packet based on
the class of service defined in the packet, not the flow.

* This solves the service-type limitation problem. We can define different types of
classes based on the needs of applications. Differentiated Services is a class-based QoS
model designed for IP.

Flow-based and class-based quality of service is: Ex: Internet telephony.

* With a flow-based scheme, each telephone call gets its own resources and guarantees.
With a class-based scheme, all the telephone calls together get the resources reserved
for the class telephony.

* These resources cannot be taken away by packets from the file transfer class or other
classes, but no telephone call gets any private resources reserved for it alone.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 149


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 150


8. THE NETWORK LAYER IN THE INTERNET

* The Internet is an interconnected collection of many networks. It can be viewed as a


collection of subnetworks or Autonomous Systems (ASes) that are interconnected.

* There is no real structure, constructed from high-bandwidth lines and fast routers.
Attached to the backbones are regional networks, and the local networks (LANs).

* The glue that holds the whole Internet together is the network layer protocol, IP
(Internet Protocol).

* Its job is to provide a way to transport datagrams from source to destination,


irrespective where ever they are and to which network they are connected.

* Communication in the Internet works as follows. The transport layer takes data
streams and breaks them up into datagrams.

(In theory, datagrams can be up to 64 Kbytes each, but in practice they are usually
not more than 1500 bytes (so they fit in one Ethernet frame).

* Each datagram is transmitted through the Internet, possibly being fragmented into
smaller units as it goes.

* When all the pieces finally get to the destination machine, they are reassembled by
the network layer into the original datagram.

* This datagram is then handed to the transport layer, which inserts it into the receiving
process' input stream.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 151


IP Addresses:

The Internet Assigned Numbers Authority (IANA) is a department of ICANN (Internet


Corporation for Assigned Names and Numbers) is responsible for global IP address
allocations.

Every host and router on the Internet has a 32 bits IP address, which encodes its network
number and host number. IP addresses were divided into the five categories listed below.

IP address formats:

* The class A, B, C, and D formats allow for up to 128 networks with 16 million hosts
each, 16,384 networks with up to 64K hosts, and 2 million networks (e.g., LANs)
with up to 256 hosts each (although a few of these are special).

* Also supported is multicast, in which a datagram is directed to multiple hosts.


Addresses beginning with 1111 are reserved for future use.

* Network addresses, which are 32-bit numbers, are usually written in dotted decimal
notation. In this format, each of the 4 bytes is written in decimal, from 0 to 255.

* For example, the 32-bit hexadecimal address C0290614 is written as


192.41.6.20. The lowest IP address is 0.0.0.0 and the highest is 255.255.255.255.

Special IP addresses:

* 127.0.0.0 is used for loop back


* IP addresses with 0 as network number refer to the current network.
* IP addresses with all 1’s is used for broadcasting on the local network.
* Non routable (private) addresses:

Private addresses cannot be routed into the internet. The router does not allow these addresses
as IP addresses externally.

* 10.0.0.0 to 10.255.255.255 (10.0.0.0/8) (255.0.0.0)


172.16.0.0 to 172.31.255.255 (172.16.0.0/12) (255.240.0.0)
192.168.0.0 to 192.168.255.255 (192.168.255.255/16) (255.255.0.0)

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 152


i). Subnets.

* Since the network IP addresses are scarce, getting a second network address would be
hard to do. So the solution is to allow a network to be split into several parts for
internal use but still act like a single network to the outside world. These parts of the
network are called subnets.

* Subnets are created by using some of the


host bits. For example if a university has 35
departments and using class B address, Out
of 16 bit host addresses 6-bits can be used
for subnets (26=64 Ethernets) and a 10-bit
host number, each with a maximum of 1022 hosts (0 and 1 are not available).

* To implement subnetting, the main router needs a subnet mask that indicates the split
between network + subnet number and host, as shown in the below Fig.

* Subnet masks are


also written as
255.255.252.0. or

An alternative
notation is /22 to indicate that the subnet mask is 22 bits long.

* In this example, the first subnet might use IP addresses starting at 130.50.4.1; the
second subnet might start at 130.50.8.1; the third subnet might start at 130.50.12.1;
and so on. To see why the subnets are counting by fours, note that the corresponding
binary addresses are as follows:

Subnet 1: 10000010 00110010 000001|00 00000001


Subnet 2: 10000010 00110010 000010|00 00000001
Subnet 3: 10000010 00110010 000011|00 00000001

* Here the vertical bar (|) shows the boundary the left 6-bit indicates subnet number;
and the right 10-bit indicates host number.

* For example, a packet addressed to 130.50.15.6 and arriving at the main router is
ANDed with the subnet mask 255.255.252.0/22 to give the address 130.50.12.0.

Packet address: 10000010 00110010 00001111 00000110 130.50.15.6


Subnet mask : 11111111 11111111 11111100 00000000 255 .255.252.0
Address : 10000010 00110010 00001100 00000000 130.50.12.0

* This address is looked up in the routing tables to find out which output line to use to
get to the router for subnet 3.

Internet users worldwide (2015) : 317 crores (3.17 billion)


Max addresses using 32 bit : 429,49,67,296 (However, large blocks of IPv4
addresses are reserved for special uses and are unavailable for public allocation).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 153


ii). CIDR (Classless Inter Domain Routing).

* The drastic growth of the Internet and the flaws in classful addressing led to the near
depletion of IP addresses and also a large part of available addresses were wasted.

* To overcome address depletion, classless addressing was designed. In this scheme,


there are no classes, but the addresses are still granted in blocks.

Address Blocks : In classless addressing, a block (range) of addresses is allocated. The size
of the block (the number of addresses) varies based on the nature and size of the entity.

* With CIDR, each routing table entry is extended by giving it a 32-bit mask. Thus,
there is now a single routing table for all networks consisting of an array of (IP
address, subnet mask, outgoing line) triples.

* When a packet comes in, its destination IP address is first extracted. In case,
multiple entries match, the longest mask is used.

Ex: If there is a match for a /20 mask and a /24 mask, the /24 entry is used.

The routing tables all over the world are now updated with the three assigned entries. Each
entry contains a base address and a subnet mask. These entries (in binary) are:

Address Mask
C: 11000010 00011000 00000000 00000000 11111111 11111111 11111000 00000000
E: 11000010 00011000 00001000 00000000 11111111 11111111 11111100 00000000
O: 11000010 00011000 00010000 00000000 11111111 11111111 11110000 00000000

If a packet comes in, addressed to 194.24.17.4, this address is Boolean ANDed with all the
three MASK addresses (C,E and O) to find the match.

194.24.17.4 11000010 00011000 00010001 00000100


Compare O mask 11111111 11111111 11110000 00000000
Boolean ANDed Result 11000010 00011000 00010000 00000000

* This value matches the O base. If no longer matches are found farther down the table,
the O entry is used and the packet is sent along the line named in it.

* The binary of 194.24.17.4 when binary ANDed with C and E masks their respective
results does not match with their base address.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 154


iii). Network Address Translation (NAT)

* With the ever growing internet users and shortage of IP addresses lead to the
development of network address translation (NAT).

* NAT enables a user to have a large set of addresses internally and one address, (or a
small set of addresses,) externally.

* For this the Internet authorities have reserved three sets of addresses as private
addresses, any user can use these addresses without any permission.

Range Total
24
10.0.0.0 10.255.255.255/8 2 (16,777,216 hosts)
172.16.0.0 172.31.255.255/12 220 (1,048,576 hosts)
192.168.0.0 192.168.255.255/16 216 (65,536 hosts)

* The main function of the NAT is to convert internal (private) address to external IP
address and vice versa.

* The operation of NAT is shown in the below figure. Within the company premises,
every machine has a unique (private) address of the form 10.x.y.z.

* However, when a packet leaves the company premises, it passes through a NAT box
that converts the internal IP source address, 10.0.0.1 to the company's true IP address,
198.60.42.12.

* Most of the IP packets carry either TCP or UDP payloads. Each outgoing TCP or
UDP message contains both a source port and a destination port. Together, these ports
serve to identify the processes using the connection on both ends.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 155


Translation Table:

* NAT router maintains a two column (private address and external address) translation
table to convert incoming private address to external IP address and vice versa.

* In the above example 25.8.2.10 is the destination address, 172.18.3.1 is the private
address and 200.24.5.8 is the NAT router address.

* When the router translates the source address of the outgoing packet, it makes
note of the destination address-where the packet is going.

* When the response comes back from the destination, the router uses the source
address of the packet (as the external address) to find the private address of the
packet.

Using Both IP Addresses and Port Numbers:

* Suppose if two hosts with addresses 172.18.3.1 and 172.18.3.2 inside a private
network need to access the HTTP server on external host 25.8.3.2.

* In this case the translation table must have five columns, instead of two, that should
include unique source and destination port numbers apart from private addresses.

* When the response from HTTP comes back, the combination of source address
(25.8.3.2) and unique destination port number (1400) defines the-private network
host to which the response should be directed.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 156


Internet Control Protocols:

* In addition to IP, which is used for data transfer, the Internet has several control
protocols used in the network layer, including ICMP, ARP, RARP, BOOTP, and
DHCP.

a). ICMP.

* The IP protocol has no error-reporting or error-correcting mechanism.

* It also lacks a mechanism for host and management queries. A host sometimes needs
to determine if a router or another host is alive.

* The Internet Control Message Protocol (ICMP) has been designed to compensate for
the above two deficiencies.

* However, ICMP does not correct errors-it simply reports them. Error correction is left
to the higher-level protocols.

ICMP messages are divided into two broad categories: error-reporting messages and query
messages.

i). The error-reporting messages: report problems that a router or a host (destination) may
encounter when it processes an IP packet.

ii). The query messages: which occur in pairs, help a host or a network manager get specific
information from a router or another host. For example, nodes can discover their neighbors.

Error reporting messages:

1. Destination Unreachable: When a router cannot route a datagram or a host cannot deliver
a datagram, the datagram is discarded and the router or the host sends a destination-
unreachable message back to the source host that initiated the datagram.

2. Source Quench: This message has two purposes. First, it informs the source that the
datagram has been discarded. Second, it warns the source that there is congestion somewhere
in the path and that the source should slow down (quench) the sending process.

3.Time Exceeded: The TIME EXCEEDED message is sent when a packet is dropped because
its counter has reached zero. This event is a symptom that packets are looping, that there is
enormous congestion, or that the timer values are being set too low.

4.Parameter Problem: If a router or the destination host discovers an ambiguous or missing


value in any field of the datagram, it discards the datagram and sends a parameter-problem
message back to the source.

5.Redirection: The REDIRECT message is used when a router notices that a packet seems to
be routed wrong. It is used by the router to tell the sending host about the probable error.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 157


Query messages:

* The ECHO and ECHO REPLY messages are used to see if a given destination is
reachable and alive. Upon receiving the ECHO message, the destination is expected to
send an ECHO REPLY message back.

* The TIMESTAMP REQUEST and TIMESTAMP REPLY messages are similar,


except that the arrival time of the message and the departure time of the reply are
recorded in the reply. This facility is used to measure network performance.

b). IGMP:

* IGMP is a Internet group management protocol. It is not a multicasting routing


protocol; it is a protocol that manages group membership.

Group Management: The IGMP protocol gives the multicast routers information about the
membership status of hosts (routers) connected to the network, so that it can create and
update a list of loyal members related to each router interface.

IGMP Messages : The current version of IGMP has three types of messages: the query, the
membership report, and the leave report. There are two types of query messages: general and
special.

Message format:

Type: This 8-bit field defines the type of message (query. Membership, leave). The value of the
type is shown in both hexadecimal and binary notation.

Maximum Response Time: This 8-bit field defines the amount of time in which a query must
be answered. For example, if the value is 100, it means 10 s.

Checksum: This is a 16-bit field carrying the checksum. The checksum is calculated over
the 8-byte message.

Group address: The value of this field is 0 for a general query message. The value defines
the group id (multicast address of the group) in the special query, the membership report, and
the leave report messages.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 158


IGMP Operation

* IGMP operates locally. A multicast router connected to a network has a list of


multicast addresses of the groups with at least one loyal member in that network.

* For each group, there is one router that has the duty of distributing the multicast
packets destined for that group. This means that if there are three multicast routers
connected to a network, their lists of group ids are mutually exclusive.

* For example, in the above figure only router R is the distributing router that
distributes packets to the multicast address of 225.70.8.20. Multicast routers R1 and
R2, could be the recipients of router R in this network.

* Routers RI and R2 may be distributors for some of these groups in other networks, but
not on this network.

Joining a Group: A host or a router can join a group. A host maintains a list of processes
that have membership in a group. When a process wants to join a new group, it sends its
request to the host. The host adds the name of the process and the name of the requested
group to its list. If this is the first entry for this particular group, the host sends a membership
report message. If not, there is no need to send the membership report.

Leaving a Group: When a host sees that no process is interested in a specific group, it sends
a leave report. Before purging the group from its list, to make sure, the router sends a special
query message and inserts the group id, or multicast address, related to the group. The router
allows a specified time for any host or router to respond.

Monitoring Membership: The multicast router is responsible for monitoring all the hosts or
routers in a LAN. In this the router periodically sends a general query message with a
maximum response time of 10 s. The host or router should respond with a membership report
if it is interested in a group.

However, if there is a common interest (two hosts, for example, are interested in the same
group), only one response is sent for that group to prevent unnecessary traffic. This is called a
delayed response.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 159


Static and Dynamic Mapping:

* To deliver a packet to a host or a router requires two levels of addressing: logical and
physical.

* We need to be able to map a logical address to its corresponding physical address and
vice versa. These can be done by using either static or dynamic mapping.

Static mapping:

* Involves in the creation of a table manually that associates a logical address (host IP
address) with a physical address (Ethernet - 48 bit MAC address).

* This table is stored in each machine on the network. For example, a machine that
knows, the IP address of another machine can look into the table to know its
physical address.

* This has some limitations because physical addresses may change when a machine
could change its NIC or a mobile computer can move from one physical network to
another, resulting in a change in its physical address.

Dynamic mapping:

* Each time a machine knows one of the two addresses (logical or physical), it can use a
protocol to find the other one.

* Two protocols have been designed to perform dynamic mapping:

i). Address resolution protocol (ARP)


ii). Reverse Address resolution protocol (RARP).

* ARP maps and IP address to a MAC address; and RARP maps a MAC address to an
IP address. (RARP is now obsolete. It has been replaced by DHCP).

i). ARP: Mapping Logical (IP address) to Physical (MAC) Address.

* When a host (or a router) has an IP datagram to send to another host or router, it needs
both physical address and the logical (IP) address of the receiver.

* Since the logical (IP) address can be obtained from the DNS, the sender needs the
physical address of the receiver.

* To find the physical address of the receiver, the sending host (or the router)
broadcasts an ARP query packet which includes the physical and IP addresses of the
sender and the IP address of the receiver.

* Every host or router on the network receives and processes the ARP query
packet, but only the intended recipient recognizes its IP address and sends back an
ARP response packet which contains the recipient's IP and physical addresses.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 160


* The packet is unicast directly to the inquirer by using the physical address received
in the query packet.

ii). RARP:

* RARP (Reverse Address Resolution Protocol) works in the reverse way. It allows a
newly-booted workstation to broadcast its Ethernet address (Ex: 48-bit Ethernet
address ex: 14.04.05.18.01.25) and request for a corresponding IP address.

* The RARP server sees this request, looks up the Ethernet address in its configuration
files, and sends back the corresponding IP address.

* A disadvantage of RARP is that it uses a destination address of all 1s (limited


broadcasting) to reach the RARP server. However, such broadcasts are not forwarded
by routers, so a RARP server is needed for each network.

iii). BOOTP (Bootstrap Protocol):

* To get around this problem, an alternative bootstrap protocol called BOOTP was
invented. Unlike RARP, BOOTP uses UDP messages, which are forwarded over
routers.

* It also provides a diskless workstation with additional information, including the IP


address of the file server holding the memory image, the IP address of the default
router, and the subnet mask to use.

* A serious problem with BOOTP is that it requires manual configuration of tables


mapping IP address to Ethernet address.

* When a new host is added to a LAN, it cannot use BOOTP until an administrator has
assigned it an IP address and entered its (Ethernet address, IP address) into the
BOOTP configuration tables manually.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 161


iv). DHCP:

* DHCP (Dynamic Host Configuration Protocol). DHCP allows both manual IP address
assignment and automatic assignment. Like RARP and BOOTP, DHCP is based on
the idea of a special server that assigns IP addresses to hosts asking for one.

* The DHCP server need not be on the same LAN as the requesting host. Since the
DHCP server may not be reachable by broadcasting, a DHCP relay agent is needed on
each LAN.

* To find its IP address, a newly-booted machine broadcasts a DHCP DISCOVER


packet. The DHCP relay agent on its LAN intercepts all DHCP broadcasts.

* When it finds a DHCP DISCOVER packet, it sends the packet as a unicast packet to
the DHCP server, possibly on a distant network.

* The only piece of information the relay agent needs is the IP address of the DHCP
server.

Dynamic Address Allocation:

* DHCP has a database with a pool of available IP addresses. When a DHCP


client requests a temporary IP address, the DHCP server goes to the pool of available
(unused) IP addresses and assigns an IP address for a negotiable period of time.

* When a DHCP client sends a request to a DHCP server, the server first checks its
static database. If an entry with the requested physical address exists in the static
database, the permanent IP address of the client is returned.

* On the other hand, if the entry does not exist in the static database, the server selects
an IP address from the available pool, assigns the address to the client, and adds the
entry to the dynamic database.

* The IP address assignment may be for a fixed period of time, a technique called
leasing. Just before the lease expires, the host must ask the DHCP for a renewal. If it
fails to make a request or the request is denied, the host may no longer use the IP
address.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 162


Autonomous Systems:

* Internet is so large that one routing protocol cannot handle the task of updating the
routing tables of all routers. For this reason, an internet is divided into autonomous
systems.

* An autonomous system (AS) is a group of networks and routers under the authority
of a single administration.

Types of Autonomous Systems:

* The Internet is divided into hierarchical domains called autonomous systems (AS).
These AS can be divided into three categories: stub, multihomed, and transit.

i). Stub AS:

A stub AS has only one connection to another AS. So it can be either a source or a sink. Data
traffic cannot pass through a stub AS. Example: small corporation or a small local ISP.

ii). Multi homed AS:

A multihomed AS has more than one connection to other ASs, but it is still only a source or
sink for data traffic.

* It can send and receive data traffic from more than one AS., but there is no transient
traffic. It does not allow data coming from one AS and going to another AS to pass
through.

* A good example of a multihomed AS is a large corporation that is connected to more


than one regional or national AS that does not allow transient traffic.

iii). Transit AS:

A transit AS is a multihomed AS that also allows transient traffic. Good examples of transit
ASs are national and international ISPs (Internet backbones).

Intra and Inter domain routing:

Routing inside an autonomous system is referred to as intra domain routing. Routing between
autonomous systems is referred to as inter domain routing.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 163


* Each autonomous system can choose one or more intra-domain routing protocols to
handle routing inside the autonomous system. However, only one inter-domain
routing protocol handles routing between autonomous system.

Intra (Interior) and Inter (Exterior) domain Routing protocols:

RIP: The Routing Information Protocol (RIP) is an intra domain routing protocol used inside
an autonomous system. It is a very simple protocol based on distance vector routing.

OSPF: Open shortest path first allow the administrator to assign cost for passing through a
network based on the type of service required. This is based on link state protocol.

BGP: Border gateway protocol defines the policy what paths should be chosen which can be
set by the administrator.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 164


1. Intra domain Routing:

a). RIP: (based on HOP count)

* The Routing Information Protocol (RIP) is an intra-domain routing protocol used


inside an autonomous system. It is a very simple protocol based on distance vector
routing.

RIP implements distance vector routing directly with some considerations:

i). In an autonomous system, we are dealing with routers and networks (links). The routers
have routing tables; networks do not.

ii). The metric used by RIP is the distance, defined as the number of links (networks) or a hop
count to reach the destination.

iii). Infinity is defined as 16, which means that any route in an autonomous system using RIP
cannot have more than 15 hops.

iv). The first column of a routing table is the destination network address.

v). The next-node column defines the address of the router to which the packet is to be sent to
reach its destination.

* Below figure shows an autonomous system with seven networks and four routers. The
table R1 has seven entries to show how to reach each network in the autonomous
system.

* Router Rl is directly connected to networks 130.10.0.0 and 130.11.0.0, which means


that there are no next-hop entries for these two networks. To send a packet to
195.2.4.0 or 195.2.5.0 networks, router R1 needs to deliver the packet to R2. For
195.6.0 network the packet has to pass through routers R2 and R3 (3 hops).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 165


* The next-node entry for these three networks is the interface of router R2 with IP
address 130.10.0.1. To send a packet to the two networks at the far right, router Rl
needs to send the packet to the interface of router R4 with IP address 130.11.0.1. The
other tables can be explained similarly.

b). OSPF (The Interior Gateway Routing Protocol):

* The Open Shortest Path First or OSPF protocol is an intra domain routing protocol
based on link state routing. Its domain is also an autonomous system.

a). Areas: OSPF divides an autonomous system into areas. An area is a collection of
networks, hosts, and routers connected between them. Routers inside an area flood the area
with routing information.

b). Border routers: At the border of an area, special routers called area border routers
summarize the information about the area and send it to other areas.

c). Backbone: The backbone serves as a primary area and the other areas as secondary areas.
The routers inside the backbone are called the backbone routers. Each area has an area
identification. The area identification of the backbone is shown below.

OSPF distinguishes four classes of routers:

1. Internal routers are wholly within one area.


2. Area border routers connect two or more areas.
3. Backbone routers are on the backbone.
4. AS boundary routers talk to routers in other ASes.

Metric:

* The OSPF protocol allows the administrator to assign a cost, called the metric, to each
route. The metric can be based on a type of service (minimum delay, maximum
throughput, and so on).

* As a matter of fact, a router can have multiple routing tables, each based on a different
type of service.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 166


Types of Links: In OSPF terminology, a connection is called a link. Four types of links have
been defined:

a). point-to-point, b). transient, c). stub, and d). virtual

a). Point-to-point:

* A point-to-point link connects two routers without any other host or router in
between. In other words, the purpose of the link (network) is just to connect the two
routers. There is no need to assign a network address to this type of link.

b). Transient :

* A transient link is a network with several routers attached to it. The data can enter
through any of the routers and leave through any router. All LANs and some WANs
with two or more routers are of this type.

For example, To show that each router is connected to every other router through one single
network, one of the routers in the network is assigned a dual purpose; it is a true router and a
designated router as shown in Figure (c).

c). stub:

* A stub link is a network that is connected to only one router. The data packets enter
the network through this single router and leave the network through this same
router.

* We can show this situation using the router as a node and using the designated router
for the network. However, the link is only one-directional, from the router to the
network

d). Virtual:

* When the link between two routers is broken, the administration may create a virtual
link between them, using a longer path that probably goes through several routers.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 167


2. Inter domain Routing:

a). BGP:

* Border Gateway Protocol (BGP) is an inter-domain (Exterior Gateway) routing


protocol using path vector routing.

Path Vector Routing:

* Path vector routing is used for inter-domain routing. The principle of path vector
routing is similar to that of distance vector routing.

* In path vector routing, we assume that there is one node in each autonomous system
that acts on behalf of the entire autonomous system. This node is known as the
speaker node.

* The speaker node in an AS creates a routing table and advertises it to speaker nodes in
the neighboring ASs.

* Only speaker nodes in each AS can communicate with each other. A speaker node
advertises the path, (not the metric of the nodes), in its autonomous system or other
autonomous systems.

Initialization: At the beginning, each speaker node can know only the reachability of nodes
inside its autonomous system. The below figure shows the initial tables for each speaker node
in a system made of four ASs.

* Node Al is the speaker node for ASl, Bl for AS2, Cl for AS3, and Dl for AS4. Node
Al creates an initial table that shows Al to A5 are located in ASI and can be reached
through it.

* Node Bl advertises that Bl to B4 are located in AS2 and can be reached through Bl.
In the same manner other speaker nodes C1 and D1 also advertises their nodes.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 168


Sharing: Just as in distance vector routing, in path vector routing, a speaker in an
autonomous system shares its table with immediate neighbors. In the above figure, node Al
shares its table with nodes Bl and Cl. Node Cl shares its table with nodes Dl, Bl, and Al.
Node Bl shares its table with Cl and Al. Node Dl shares its table with Cl.

Updating: When a speaker node receives a two-column table from a neighbor, it updates its
table by adding the nodes that are not in its routing table. After a while each speaker has a
table and knows how to reach each node in other ASs.

The below figure shows the tables for each speaker node after the system is stabilized.

* If router Al receives a packet for nodes A3, it knows that the path is in ASI (the
packet is at home); but if it receives a packet for Dl, it knows that the packet should
go from ASl, to AS3, and then to AS4.

* On the other hand, if node Dl in AS4 receives a packet for node A2, it knows it should
go through AS4, AS3, and AS 1.

Loop prevention: When a router receives a message, it checks to see if its autonomous
system is in the path list to the destination. If it is, looping is involved and the message is
ignored.

Policy routing. When a router receives a message, it can check the path. If one of the
autonomous systems listed in the path is against its policy, it can ignore that path and that
destination. It does not update its routing table with this path, and it does not send this
message to its neighbors.

Optimum path. We definitely cannot include metrics in this route because each autonomous
system that is included in the path may use a different criterion for the metric.

* One system may use, internally, RIP, which defines a hop count as the metric; another
may use OSPF with minimum delay defined as the metric. The optimal path is the
path that fits the organization.

* In our previous figure, a path from AS4 to AS1 can be AS4-AS3-AS2-AS1, or it can
be AS4-AS3-AS1. Which one to be selected depends on the metric. It can be hops,
time, security, safety, and reliability etc.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 169


BGP Sessions:

The exchange of routing information between two routers using BGP takes place in a session.
To create a reliable environment, BGP uses the services of TCP.

External BGP: The E-BGP


session is used to exchange
information between two speaker
nodes belonging to two different
autonomous systems.

Internal BGP: The I-BGP


session, on the other hand, is used
to exchange routing information
between two routers inside an
autonomous system.

Path Attributes:

* The path is actually a list of attributes which gives some information about the path.

* The list of attributes helps the receiving router make a more-informed decision when
applying its policy.

* BGP is fundamentally a distance vector protocol, but quite different from most others
such as RIP.

* Instead of maintaining just the cost to each destination, each BGP router keeps track
of the path used.

* Similarly, instead of periodically giving each neighbor its estimated cost to each
possible destination, each BGP router tells its neighbors the exact path it is using.

* As an example, consider the BGP routers shown below. In particular, consider F's
routing table. Suppose that it uses the path FGCD to get to D.

* When the neighbors give it routing information, they provide their complete paths, as
shown in the below figure. (a) A set of BGP routers. (b) Information sent to F.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 170


Mobile IP

* IP addresses are designed for stationary systems and they doesn’t work with mobile
devices because the devices tend to move. Mobile IP solves this problem.

* Mobile IP has two addresses for a mobile host: 1). one home address (HA) and
2). one care-of address (COA).

* The home address is permanent; the care-of address changes as the mobile host
moves from one network to another. To make the change of address transparent to the
rest of the Internet requires a home agent and a foreign agent.

* When ever the mobile device is moved to a new place it should first contact the
foreign agent available in that area. To communicate with a remote host, a mobile
host goes through three phases: a). Agent discovery, b). Registration, c). Data
transfer.

* Agent discovery can be through either agent advertisement or through agent


solicitation.

* The main purpose of the registration is to inform the HA of the current location for
correct forwarding of packets. Registration can be done in two different ways
depending on the location of the COA (care of address).

* If the COA is at the FA, the Mobile device sends its registration request containing
the COA to the FA which is forwarding the request to the HA. Once authenticated by
the home agent (HA) the foreign agent (FA) registers the mobile device (MN).
Example: Suppose a correspondent node CN wants to send an IP packet to the MN.

* The IP packet from the CA is tunneled to COA (here FA) and FA forwards the packet
to Mobile device (MN).

* Mobile device (MN) to CN is a direct process where the MN can communicate


directly with CN via FA.

* Another problem is if the mobile hosts that leave abruptly. The solution is to make
registration valid only for a fixed time interval. If it is not refreshed periodically, it
times out, so the foreign host can clear its tables. Regarding security cryptographic
authentication protocols are used.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 171


IPV4:

* IPv4 is an unreliable and a connectionless datagram protocol, without error control or


flow control (except for error detection on the header). For reliability IPv4
must be paired with a reliable protocol such as TCP.

* IPv4 uses the datagram approach. Each datagram is handled independently, and can
follow a different route to the destination.

* Datagrams sent by the same source to the same destination could arrive out of order.
Also, some could be lost or corrupted during transmission.

* A datagram is a variable length packet consisting of two parts: header and data.

* The header is 20 to 60 bytes in length and contains information essential to routing


and delivery.

1. VER is a 4-bit field defines the version of the IPv4 protocol. Currently the version is 4.

2. HLEN is a 4-bit field defines the total header length of the datagram.

With no options, the header length is 20 bytes, and the value of this field is 5 (5 x 4 = 20).
When the option field is at its maximum size, the value of this field is 15 (15 x 4 = 60).

3. Services: This field, previously called service type, is now called differentiated services.

The first 3 bits are called precedence bits. The next 4 bits are called type of service (TOS)
bits, and the last bit is not used.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 172


4. Total length. This 16-bit field defines the total length (header plus data) of the IPv4
datagram in bytes.

5. Identification. This field is used in fragmentation.

6. Flags. This field is used in fragmentation

7. Fragmentation offset. This field is used in fragmentation

8. Time to live. A datagram has a limited lifetime in its travel through an internet. This field
is used mostly to control the maximum number of hops (routers) visited by the datagram.

9. Protocol. This 8-bit field defines the higher-level protocol used such as TCP, UDP,
ICMP and IGMP. The value of this field helps the receiving network layer know to which
protocol the data belong.

10. Checksum: The checksum used to identify the data packet integrity.

11.Source address. This 32-bit field defines the IPv4 address of the source.

12. Destination address. This 32-bit field defines the IPv4 address of the destination.

Fields Related to Fragmentation:

* The fields that are related to fragmentation and reassembly of an IPv4 datagram are
the a).identification, b). flags, and c). fragmentation offset fields.

a). Identification: This 16-bit field identifies a datagram originating from the source host.

* When a datagram is fragmented, the value in the identification field (number) is


copied to all fragments.

* The destination knows that all fragments having the same identification value must
be assembled into one datagram.

b). Flags: This is a 3-bit field. The first bit is reserved.

* The second bit is called the do not fragment bit. If its value is 1, the machine must not
fragment the datagram. If its value is 0, the datagram can be fragmented if necessary.

* The third bit is called the more fragment bit. If its value is 1, it means the datagram is
not the last fragment; there are more fragments after this one. If its value is 0, it means
this is the last or only fragment.

c). Fragmentation offset:

* This 13-bit field shows the relative position of this fragment with respect to the whole
datagram. It is the offset of the data in the original datagram measured in units of 8
bytes.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 173


IPv6:

Packet Format

* The IPv6 packet (128 bits) is composed of a mandatory base header followed by the
payload. The payload consists of two parts: optional extension headers and data from an
upper layer.

* The base header occupies 40 bytes, whereas the extension headers and data from the
upper layer contain up to 65,535 bytes of information.

1. Version: This 4-bit field defines the version number of the IP. For IPv6, the value is 6.

2. Priority: The 4-bit priority field defines the priority of the packet with respect to traffic
congestion.

3. Flow label: The flow label is a 3-byte (24-bit) field that is designed to provide special
handling for a particular flow of data.

4. Payload length: The 2-byte payload length field defines the length of the IP datagram
excluding the base header.

5. Next header: The next header is an 8-bit field defining the header that follows the base
header in the datagram. The next header is either one of the optional extension headers used
by IP or the header of an encapsulated packet such as UDP or TCP.

6. Hop limit: This 8-bit hop limit field serves the same purpose as the TTL field in IPv4.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 174


7. Source address: The source address field is a 16-byte (128-bit) Internet address that
identifies the original source of the datagram.

8. Destination address. The destination address field is a 16-byte (128-bit) Internet address
that usually identifies the final destination of the datagram.

Priority:

* The priority field defines the priority of each packet with respect to other packets
from the same source.

* For example, if one of two consecutive datagrams must be discarded due to


congestion, the datagram with the lower packet priority will be discarded.

Flow Label:

* To a router, a flow is a sequence of packets that share the same characteristics, such as
traveling the same path, using the same resources and so on.

*. All packets belonging to the same flow have the same source, same destination, same
priority, and same options.

* The flow label can speed up the processing of a packet by a router. When a router
receives a packet, instead of consulting its routing table it can easily look in a flow
label table for the next hop.

IPv4 vs IPv6:

IPv4: Although IPv4 is well designed, it has some deficiencies (listed below) that make it
unsuitable for the fast-growing Internet.

* Despite all short-term solutions, such as subnetting, classless addressing, and NAT,
address depletion is still a long-term problem in the Internet.

* The Internet must accommodate real-time audio and video transmission. This type of
transmission requires minimum delay strategies and reservation of resources not
provided in the IPv4 design.

* The Internet must accommodate encryption and authentication of data for some
applications. No encryption or authentication is provided by IPv4.

IPv6: To overcome these deficiencies, IPv6 (Internetworking Protocol, version 6), was
proposed. IPv6, has some advantages over IPv4 that can be summarized as follows:

* Larger address space. An IPv6 address is 128 bits long compared with the 32-bit
address of IPv4, this is a huge (296) increase in the address space.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 175


* Better header format. IPv6 uses a new header format. This simplifies and speeds up
the routing process because most of the options do not need to be checked by routers.

* New options. IPv6 has new options to allow for additional functionalities.

* Allowance for extension. IPv6 is designed to allow the extension of the protocol if
required by new technologies or applications.

* Support for resource allocation. In IPv6, the type-of-service field has been removed,
but a mechanism called flow label has been added to enable the source to request
special handling of the packet. This mechanism can be used to support traffic such as
real-time audio and video.

* Support for more security. The encryption and authentication options in IPv6 provide
confidentiality and integrity of the packet.

Comparison Between IPv4 and IPv6 Headers:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 176


Transition from IPV4 to IPV6:

* Because of the huge number of systems on the Internet, the transition from IPv4 to
IPv6 cannot happen suddenly.

* Three strategies have been devised by the IETF (Internet Engineering Task Force) to
help the transition.

i). Dual Stack:

* All hosts, before migrating completely to version 6, have a dual stack of protocols. In
other words, a station must run IPv4 and IPv6 simultaneously until all the Internet
uses IPv6. See below Figure for the layout of a dual-stack configuration.

* To determine which version to use when sending a packet to a destination, the source
host queries the DNS.

* If the DNS returns an IPv4 address, the source host sends an IPv4 packet. If the DNS
returns an IPv6 address, the source host sends an IPv6 packet.

ii). Tunneling:

* Tunneling is a strategy used when two computers using IPv6 want to communicate
with each other and the packet must pass through a region that uses IPv4.

* To pass through this region, the packet must have an IPv4 address. So the IPv6 packet
is encapsulated in an IPv4 packet when it enters the region, and it leaves its capsule
when it exits the region.

* It seems as if the IPv6 packet goes through a tunnel at one end and emerges at the
other end.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 177


* To make it clear that the IPv4 packet is carrying an IPv6 packet as data, the
protocol value is set to 41. Tunneling is shown in the below figure.

iii). Header Translation:

* Header translation is necessary when the majority of the Internet has moved to IPv6
but some systems still use IPv4.

* The sender wants to use IPv6, but the receiver does not understand IPv6. Tunneling
does not work in this situation.

* In this case, the header format must be totally changed through header translation.
The header of the IPv6 packet is converted to an IPv4 header .

* Header translation uses the mapped address to translate an IPv6 address to an IPv4
address. Below table lists some rules used in transforming an IPv6 packet header to an
IPv4 packet header.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 178


9. THE TRANSPORT LAYER

Services Provided to the Upper Layers:

* The transport layer provides efficient, reliable, and cost-effective service to its users.
To achieve this goal, it uses the services provided by the network layer.

* The (logical) relationship of the network, transport, and application layers is


illustrated in the figure.

* Transport layer provides reliable service. Lost packets can be detected and
compensated.

* Application programmers write code according to a standard set of primitives, without


worrying about interfaces and unreliable transmission.

* For this reason, the bottom four layers are considered as the transport service
provider, whereas the upper layer(s) are the transport service user.

* In this way the Transport layer forms the major boundary between the provider and
user of the reliable data transmission service.

Transport Service Primitives:

* Transport service primitives are listed below. Consider an application with a server
and a number of remote clients.

* LISTEN: Initially a server executes a LISTEN primitive, typically to block the server
until a client turns up.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 179


* CONNECT: When a client wants to talk to the server, it executes a CONNECT
primitive. This primitive is carried by blocking the caller and sending a packet to the
server.

* The client's CONNECT call causes a CONNECTION REQUEST TPDU to be sent


to the server.

* The server (LISTEN) sends a CONNECTION ACCEPTED TPDU back to the client.
When this TPDU arrives, the client is unblocked and the connection is established.

* SEND and RECEIVE: primitives are used to exchange data. Either party can do a
(blocking) RECEIVE to wait for the other party to do a SEND.

* DISCONNECT: When a connection is no longer needed. Transport user issues a


DISCONNECT TPDU to the remote entity. Upon arrival, the connection is released.

TPDU (Transport Protocol Data Unit):

* TPDU exchanged by the transport layer are contained in packets. In turn, packets are
contained in frames.

* When a frame arrives, the data link layer processes the frame header and passes the
contents of the frame payload field up to the network entity.

* The network entity processes the packet header and passes the contents of the packet
payload up to the transport entity as shown in the figure.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 180


Berkeley Sockets:

* The socket primitives used in Berkeley UNIX for TCP are widely used for Internet
programming. The first four primitives in the list are executed in that order by servers.

i). The SOCKET primitive creates a new end point and allocates table space for it
within the transport entity.

ii). The BIND primitive is used to assign a network addresses for the newly-created
sockets. Once a server has bound an address to a socket, remote clients can connect to
it.

iii), The LISTEN call allocates space to queue incoming calls coming from several
clients.

iv). The ACCEPT primitive is executed by the server and returns a normal file
descriptor, which can be used for reading and writing.

* When a TPDU asking for a connection arrives, the server transport entity fork off a
process (fork is an operation whereby a process creates a copy of itself) creates a new
socket with the same properties as the original one and returns a file descriptor for it
and go back to waiting for the next connection on the original socket.

* At the client side also a socket must first be created using the SOCKET primitive, but
BIND is not required since the address used does not matter to the server.

* The CONNECT primitive blocks the caller and actively starts the connection
process. The client process is unblocked and the connection is established.

* Both sides can now use SEND and RECV to transmit and receive data over the full-
duplex connection.

* Connection release with sockets is symmetric. When both sides have executed a
CLOSE primitive, the connection is released.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 181


Elements of Transport Protocols:

i). Addressing (port):

* When an application (a user) process wishes to set up a connection to a remote


application process, it must specify which one to connect to. In the Internet, these end
points are called ports.

* While stable TSAP (Transport Service Access Point) also known as well known port
addresses are allocated permanently to some key services (e.g. the Web server).

* User processes often want to talk to other user processes that only exist for a short
time follow some scheme like initial connection protocol.

Initial connection protocol:

* The process server listens to a set of ports at the same time, waiting for a connection
request. When users makes a CONNECT request, specifying the TSAP (port) address
of the service they want. If no server is waiting for them, they get a connection to the
process server.

* After it gets the


incoming request,the
process server
releases the
requested server,
allowing it to
connect the user.

* The process server


goes back to
listening for new
requests (fig b).

* Suppose if the user requests a special service which the process server cannot create,
it uses a special process called a name server (or directory server).

* To find the TSAP address for the required service name, such as ''time of day,'' a
user sets up a connection to the name server, sends a message specifying the
service name; and the name server sends back the TSAP address.

* Then the user releases the connection with the name server and establishes a new one
with the desired service. In this model, when a new service is created, it must register
itself with the name server, giving both its service name and its TSAP.

* The name server records this information in its internal database and answers the
queries related to them.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 182


ii). Connection Establishment:

* Connection establishment can be done by just sending a CONNECTION REQUEST


TPDU to the destination and wait for a CONNECTION ACCEPTED reply.

* Problems occur when the network lose, store, or duplicate packets. One way to solve
the delayed duplicate problem for data TPDUs is by using the clock-based method.

* Since control TPDUs may also be delayed, there is a potential problem in getting
both sides to agree on the initial sequence number.

* To solve this problem, the three-way handshake method is introduced. Here


synchronization method is used rather than global clock method.

The three-way handshake method:

* Fig (a). Host 1 chooses a sequence number, x, and sends a CONNECTION


REQUEST (CR) TPDU containing it to host 2.

(a) Normal operation.

(b) Old duplicate CONNECTION REQUEST appearing out of nowhere.

(c) Duplicate CONNECTION REQUEST and duplicate ACK.

* Host 2 replies with an ACK TPDU acknowledging x and announcing its own initial
sequence number, y.

* Finally, host 1 acknowledges host 2's choice of an initial sequence number.

* Three protocol scenarios for establishing a connection using a three-way handshake.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 183


iii). Connection Release.

* There are two styles of terminating a connection: asymmetric release and symmetric
release.

Asymmetric Release: In asymmetric release, the connection is broken abruptly and may
result in data loss. Ex: Host 1 or 2 issues a DISCONNECT and the connection is released
before the second host responds. This leads to data loss.

Symmetric Release: Symmetric release treats the connection as two separate unidirectional
connections and requires each one to be released separately.
Four protocol scenarios for releasing a connection.

(a) Normal case of three-way handshake:

In Fig.(a), Host 1 sends a DR (DISCONNECTION REQUEST) to


initiate the connection release. When it arrives, Host 2 sends back
a DR TPDU, too, and starts a timer.

When this DR arrives, the original sender sends back an ACK


TPDU and releases the connection. Finally, when the ACK TPDU
arrives, the receiver also releases the connection.

(b) Final ACK lost:

Fig.(b): If the final ACK TPDU is lost, the situation is saved by


the timer.

When the timer expires, the connection is released anyway.

(c) Response lost:

Fig.(c): Now consider the case of the second DR being lost. The
user initiating the disconnection will not receive the expected
response, will time out, and will start all over again.

Assuming that the second time no TPDUs are lost and all TPDUs
are delivered correctly and on time.

(d) Response lost and subsequent DRs lost:

Fig.(d): is the same as Fig.(c) except that now we assume all the
repeated attempts to retransmit the DR also fail due to lost
TPDUs.

After N retries, the sender just gives up and releases the


connection. Meanwhile, the receiver times out and also exits.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 184


iv). Flow Control and Buffering:

a). Flow control: In some ways the flow control problem in the transport layer is the same
as in the data link layer, but in other ways it is different. The basic similarity is that in both
layers a sliding window or other scheme is needed on each connection to keep a fast
transmitter from overrunning a slow receiver.

b). Buffering: If the network service is unreliable, the sender must buffer all TPDUs sent.

(i) Chained fixed-size buffers.

* If the TPDUs are identically- sized buffers, then one TPDU per buffer can be used as
shown in the Fig (a).

* However, if there is a wide variation in TPDU size, fixed sized buffers present
problem. If the buffer size is chosen equal to the largest possible TPDU, space will be
wasted whenever a short TPDU arrives.

* If the buffer size is chosen less than the maximum TPDU size, multiple buffers will
be needed for long TPDUs, with the attendant complexity.

(ii) Chained variable-sized buffers:

* Another approach to the buffer size problem is to use variable-sized buffers, as in


Fig.(b). The advantage here is better memory utilization, at the price of more
complicated buffer management.

(iii) One large circular buffer per connection:

* A third possibility is to dedicate a single large circular buffer per connection, as in


Fig.(c). This system also makes good use of memory, provided that all connections
are heavily loaded, but is poor if some connections are lightly loaded.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 185


v). Multiplexing:

In the transport layer the need for multiplexing can arise in a number of ways.

a). Upward multiplexing

* Upward multiplexing is needed when only one network address is available on a


host and all transport connections on that machine have to use it.

* This situation, called upward multiplexing, is shown in Fig.(a). In this figure, four
distinct transport connections all use the same network connection (e.g., IP address) to
the remote host.

(a) Upward multiplexing. (b) Downward multiplexing

b). Downward multiplexing

Suppose, for example, that a subnet imposes a maximum data rate on each one.

* If a user needs more bandwidth than one virtual circuit can provide, a way out is to
open multiple network connections and distribute the traffic among them on a
round- robin basis, as indicated in Fig.(b).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 186


vi). Crash Recovery

* Let us assume that one host is sending a long file to a file server using a simple
stop-and-wait protocol. Partway through the transmission, the server crashes. When it
comes back up its tables are reinitialized and doesn’t know precisely where it
was.

* In an attempt to recover its previous status, the server might send a broadcast TPDU
to all other hosts, announcing that it had just crashed and request its clients to
inform it about the status of all open connections.

Each client can be in one of two states:

1. TPDU outstanding - S1, or

2. No TPDUs outstanding - S0.

* Based on only this state information, the client must decide whether to retransmit the
most recent TPDU.

Consider, for example, the situation in which the server's transport entity.

i). First sends an acknowledgement, and then write:

* If a crash occurs after the acknowledgement has been sent but before the write has
been done, the client will receive the acknowledgement and thus be in state S0 when
the crash recovery announcement arrives.

* The client will therefore not retransmit, (incorrectly) thinking that the TPDU has
arrived. This decision by the client leads to a missing TPDU.

ii). First write and then send the acknowledgement.

* Imagine that the write has been done but the crash occurs before the
acknowledgement can be sent. The client will be in state S1 and thus retransmit,
leading to an undetected duplicate TPDU in the output stream to the server
application process.

* No matter how the client and server are programmed, there are always situations
where the protocol fails to recover properly.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 187


The Internet Transport Protocols

Introduction to UDP:

* The User Datagram Protocol (UDP) is a connectionless, unreliable transport


protocol. It performs very limited error checking.

a). The UDP Header

* UDP packets, also known as user datagrams, have a fixed-size header of 8 bytes as
shown in the below figure.

i). Source port number: This is a 16 bits long port number used by the source host.

* In most cases, If the source host is the server, the port number, is a well-known port
number. If the source host is the client, the port number is a temporary port number.

ii). Destination port number: A 16 bit port number used by the destination host.

iii). Length: A16-bit field that defines the total length (header plus data) of the user datagram,.

iv). Checksum: The UDP checksum is optional and stored as 0 if not computed.

Applications:

* UDP is suitable for a process that requires simple request-response communication


with little concern for flow and error control (multimedia applications).

* UDP is a suitable transport protocol for multicasting. Multicasting capability is


embedded in the UDP software but not in the TCP software.

* UDP is used for management processes such as SNMP

* UDP is used for some route updating protocols such as Routing Information
Protocol (RIP).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 188


b). RPC Remote Procedure Call

* The idea behind RPC is to make a remote procedure call look as much as possible like
a local one.

* In the simplest form, to call a remote procedure, the client program follows a
procedure called the client stub (represents the server procedure in the client's
address space).Similarly, the server is bound with a procedure called the server stub.

* These procedures hide the fact that the procedure call from the client to the server is
not local.

The actual steps in making an RPC are shown in the below Figure. The stubs are shaded.

Step 1 is the client calling the client stub. This call is a local procedure call.

Step 2 is the client stub packing the parameters into a message and make a system call to send
the message. Packing the parameters is called marshaling.

Step 3 is the kernel (OS) sending the message from the client machine to the server machine.

Step 4 is the kernel (OS) passing the incoming packet to the server stub.

Finally, step 5 is the server stub calling the server procedure with the unmarshaled
parameters. The reply traces the same path in the other direction.

Constraints: Despite the conceptual elegance of RPC, there are a few snags.

Using pointers: Pointers can be passed if both the client and server are in same address
space. With RPC, passing pointers is impossible because the client and server are in different
address spaces.

Using global variables: Normally, the calling and called procedure can communicate by
using global variables. But in RPC the global variables are no longer shared. RPC is widely
used, but some restrictions are needed to make it work well in practice.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 189


c). The Real-Time Transport Protocol (RTP):

* The RTP is widely used in the multimedia application consists of multiple audio,
video, text, and possibly other streams. These are fed into the RTP library, which is in
user space along with the application.

* If the computer is on an Ethernet, the IP packets are then put in Ethernet frames for
transmission.

* The protocol stack for this situation is shown in Fig.(a). The packet nesting is shown
in Fig.(b).

* The basic function of RTP is to multiplex several real-time data streams onto a
single stream of UDP packets.

* Packet No: Each packet sent in an RTP stream is given a number one higher than
its predecessor. This numbering allows the destination to determine if any packets are
missing.

* Interpolation: If a packet is missing, the best action for the destination to take is to
approximate the missing value by interpolation.

* Retransmission: is not a practical option since the retransmitted packet would


probably arrive too late to be useful. As a consequence, RTP has no flow control, no
error control, no acknowledgements, and no mechanism to request retransmissions.

* Time stamping: The idea here is to allow the source to associate a timestamp with
the first sample in each packet. The timestamps are relative to the start of the stream,
so only the differences between timestamps are significant.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 190


The RTP Header:

The RTP header consists of three 32-bit words.

* The first word contains the Version field,

* The P bit indicates that the packet has been padded to a multiple of 4 bytes.

* The X bit indicates that an extension header is present.

* The CC field tells how many contributing sources are present, from 0 to 15.

* The M bit is an application-specific marker bit. It can be used to mark the start of a
video frame, the start of a word in an audio channel, or something else that the
application understands.

* The Payload type field tells which encoding algorithm has been used (e.g.,
uncompressed 8-bit audio, MP3, etc.).

* The Sequence number is just a counter that is incremented on each RTP packet sent. It
is used to detect lost packets.

* The timestamp is produced by the stream's source to note when the first sample in the
packet was made.

* The Synchronization source identifier tells which stream the packet belongs to. It is
the method used to multiplex and de-multiplex multiple data streams onto a single
stream of UDP packets.

* Finally, the Contributing source identifiers, if any, are used when mixers are present
in the studio. In that case, the mixer is the synchronizing source, and the streams
being mixed are listed here.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 191


Introduction to TCP.

Unlike UDP, TCP is a connection oriented protocol; it uses flow and error control
mechanisms at the transport level. It adds connection-oriented and reliability features to the
services of IP.

TCP Services.

* Process-to-Process Communication: Like UDP, TCP provides process-to-process


communication using well-known port numbers.

* Stream Delivery Service: Unlike UDP, TCP, allows the sending process to deliver
data as a stream of bytes and allows the receiving process to obtain data as a stream of
bytes.

* Sending and Receiving Buffers: Because the sending and the receiving processes
may not write or read data at the same speed, TCP uses sending and receiving buffer,
one for each direction.

* Full-Duplex Communication: TCP offers full-duplex service, in which data can flow
in both directions at the same time.

* Connection-Oriented Service: TCP, unlike UDP, is a connection-oriented protocol.


When a process at site A wants to send and receive data from another process at site
B, the following occurs:

1. The two TCPs establish a connection between them.


2. Data are exchanged in both directions.
3. The connection is terminated.

This is a virtual connection, not a physical connection.

Some assigned ports:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 192


The TCP Protocol.

* Every byte on a TCP connection has its own 32-bit sequence number. The sending
and receiving TCP entities exchange data in the form of segments.

* A TCP segment consists of a fixed 20-byte header (plus an optional part) followed by
zero or more data bytes.

* The TCP software decides how big segments should be. It can accumulate data from
several writes into one segment or can split data from one write over multiple
segments.

Two limits restrict the segment size.

* First, each segment, including the TCP header, must fit in the 65,515-byte IP payload.

* Second, each network has a maximum transfer unit, or MTU, and each segment must
fit in the MTU which is generally 1500 bytes (the Ethernet payload size).

* The basic protocol used by TCP entities is the sliding window protocol. When a
sender transmits a segment, it also starts a timer.

* When the segment arrives at the destination, the receiving TCP entity sends back a
segment (with data if any exist, otherwise without data) bearing an acknowledgement
number equal to the next sequence number it expects to receive.

* If the sender's timer goes off before the acknowledgement is received, the sender
transmits the segment again.

The TCP Segment Header.

* TCP segment consists of a 20-byte header. The fixed header may be followed by
header options.

* After the options, if any, up to 65,535 - 20 - 20 = 65,495 data bytes may follow,
where the first 20 refer to the IP header and the second to the TCP header.

* Segments without any data are used for acknowledgements and control messages.

* The Source and Destination port address use 16 bits each. A port (16 bit) plus its
host's IP address (32 bit) forms a 48-bit unique end point.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 193


* Sequence number: This 32-bit field defines the number assigned to the first byte of
data contained in this segment. To ensure connectivity, each byte to be transmitted is
numbered. The sequence number tells the destination which byte in this sequence
comprises the first byte in the segment.

* Acknowledgment number: This 32-bit field defines the byte number that the receiver
of the segment is expecting to receive from the other party. Acknowledgment and
data can be piggybacked together.

* The TCP header length tells how many 32-bit words are contained in the TCP
header. Next comes a 6-bit field that is not used followed by six 1-bit flags.

Flags:

* Urgent pointer (if set to 1) is used when urgent data are to be found.
* The ACK bit is set to 1 to indicate that the Acknowledgement number is valid.
* The PSH bit indicates PUSHed data- to deliver the data to the application upon arrival
and not buffer it until a full buffer has been received.
* The RST bit is used to reset a connection.
* The SYN bit is used to establish connections.
* The FIN (Finish) bit is used to release a connection.
* The Window size field tells how many bytes may be sent starting at the byte
acknowledged.
* A Checksum is also provided for extra reliability.
* Urgent pointer. This l6-bit field, which is valid only if the urgent flag is set, is used
when the segment contains urgent data.
* Options. There can be up to 40 bytes of optional information in the TCP header.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 194


TCP Connection Establishment (Three way hand shake).

* Connections are established in TCP by means of the three-way handshake.

* To establish a connection, the server, executes the LISTEN and ACCEPT primitives.

* The other side, say, the client, executes a CONNECT primitive, specifying the IP
address and port to which it wants to connect.

* The CONNECT primitive sends a TCP segment with the SYN bit ON and ACK bit
OFF and waits for a response.

* If some process is listening to the port, that process is given the incoming TCP
segment. If it accepts, an acknowledgement segment is sent back. The sequence of
TCP segments sent in the normal case is shown in the below fig(a).

Fig (a) TCP connection establishment in the normal case. Fig (b) Call collision.

In the event that two hosts simultaneously attempt to establish a connection between the same
two sockets, the sequence of events is as illustrated in fig(b).

TCP Connection Release.

* TCP connections are full duplex. To release a connection, either party can send a TCP
segment with the FIN bit set. When the FIN is acknowledged, that direction is shut
down for new data.

* Data may continue to flow indefinitely in the other direction, however. When both
directions have been shut down, the connection is released.

* Normally, four TCP segments are needed to release a connection, one FIN and one
ACK for each direction.

* To avoid the two-army problem, timers are used. If a response to a FIN is not
forthcoming within two maximum packet lifetimes, the sender of the FIN releases the
connection.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 195


TCP Connection Management:

The steps required to establish and release connections can be represented in a finite state
machine as shown in the figure.

Connection management from the Client side:

* Application program on the client machine issues a CONNECT request, the local
TCP entity in the SYN SENT state, sends a SYN segment. (Note that many
connections may be open at the same time on behalf of multiple applications).

* When the SYN+ACK arrives, TCP sends the final ACK of the three-way handshake
and switches into the ESTABLISHED state. Data can now be sent and received.

* When an application is finished, it executes a CLOSE primitive, which causes the


local TCP entity to send a FIN segment and wait for the corresponding ACK (dashed
box marked active close).

* When the ACK arrives, a transition is made to state FIN WAIT 2 and one direction of
the connection is now closed.

* When the other side closes, too, a FIN comes in, which is acknowledged.

* Now both sides are closed, but TCP waits a time equal to the maximum packet
lifetime to guarantee that no packets are left, just in case the acknowledgement was
lost. When the timer goes off, TCP deletes the connection record.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 196


Connection management from the Server side:

* The server does a LISTEN and when a SYN comes in, it is acknowledged and the
server goes to the SYN RCVD state.

* When the server's SYN is itself acknowledged, the three-way handshake is complete
and the server goes to the ESTABLISHED state. Data transfer can now occur.

* When the client is done, it does a CLOSE, which causes a FIN to arrive at the server
(dashed box marked passive close).

* The server is then signaled. When it, too, does a CLOSE, a FIN is sent to the client.
When the client's acknowledgement shows up, the server releases the connection and
deletes the connection record.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 197


TCP Transmission Policy.

* For example, suppose the receiver has a 4096-byte buffer. If the sender transmits a
2048-byte segment, the receiver will acknowledge the segment. However, since it
now has only 2048 bytes of buffer space, it will advertise a window of 2048 starting
at the next byte expected.

* Now the sender transmits another 2048 bytes, which are acknowledged, but the
advertised window is 0. The sender must stop until the application process on the
receiving host has removed some data from the buffer

* When the window is 0, the sender may not normally send segments, with two
exceptions.

* First, urgent data may be sent, for example, to allow the user to kill the process
running on the remote machine.

* Second, the sender may send a 1-byte segment to make the receiver re-announce the
next byte expected and window size. The TCP standard explicitly provides this option
to prevent deadlock if a window announcement ever gets lost.

* Senders are not required to transmit data as soon as they come in from the application.
Neither are receivers required to send acknowledgements as soon as possible.

* For example, in the figure when the first 2 KB of data came in, TCP, knowing that it
had a 4-KB window available, would have been completely correct in just buffering
the data until another 2 KB came in, to be able to transmit a segment with a 4-KB
payload. This freedom can be exploited to improve performance.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 198


TCP Congestion Control (slow start).

* When the load offered to any network is more than it can handle, congestion builds
up. In theory, congestion can be dealt with by refraining from injecting a new packet
into the network until an old one leaves (i.e., is delivered). TCP attempts to achieve
this goal by dynamically manipulating the window size.

* To do so, each sender maintains two windows: the window the receiver has granted
and a second window, the congestion window.

* Slow start is based on congestion window.

* Initially the sender sends one packet, after receiving the acknowledgement. The
congestion window is doubled, means 2 packets. (congestion window = 2).

* After receiving the two corresponding acknowledgements, the congestion window is


doubled, means 4 packets.

* This scheme doubles the congestion window every time the acknowledgements
come back, which takes one round trip time (RTT).

* As soon as the congestion window reaches the congestion threshold, further


increase of the transmission rate is linear by adding 1. (shown in fig)

* Linear increase continues until a time-out occurs due to a missing acknowledgement,


or a gap in transmitted data.

* In either case the sender sets the congestion threshold to half of the current
congestion window.

* The congestion window itself is set to one segment and the sender starts sending a
single segment.

* The exponential growth starts once more up to the new congestion threshold, then
the window grows in linear fashion as shown in the figure.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 199


Wireless TCP and UDP

* All TCP implementations nowadays assume that timeouts are caused by congestion,
not by lost packets.

* Unfortunately, this is opposite in wireless transmission where most packets are lost
due to unreliable links.

* When a packet is lost on a wired network, the sender should slow down where as in
wireless network it doesn’t need to slow down. When the sender does not know what
the network (wired or wireless) is, it is difficult to make the correct decision. A
solution proposed for this is indirect TCP.

Indirect TCP:

* Indirect TCP is to split the TCP connection into two separate connections, as shown
in the below figure.

* The first connection goes from the sender to the base station. The second one goes
from the base station to the receiver. The base station simply copies packets between
the connections in both directions.

* The advantage of this scheme is that both connections are now homogeneous.
Timeouts on the first connection can slow the sender down, whereas timeouts on the
second one can speed it up.

* The disadvantage of the scheme is that it violates the semantics of TCP. Since each
part of the connection is a full TCP connection, the base station acknowledges each
TCP segment in the usual way.

* Only now, receipt of an acknowledgement by the sender does not mean that the
receiver got the segment, only that the base station got it.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 200


Transactional TCP.

* If the packet is quite large, then the pieces must be sequenced and a mechanism must
be devised to retransmit lost pieces.

* Here using normal TCP is unattractive. The problem is the efficiency. The normal
sequence of packets for doing an RPC over TCP is shown in Fig.(a). Nine packets are
required in the best case.

(a) RPC using normal TCP. (b) RPC using T/TCP.

The nine packets are as follows:

1. The client sends a SYN packet to establish a connection.


2. The server sends an ACK packet to acknowledge the SYN packet.
3. The client completes the three-way handshake.
4. The client sends the actual request.
5. The client sends a FIN packet to indicate that it is done sending.
6. The server acknowledges the request and the FIN.
7. The server sends the reply back to the client.
8. The server sends a FIN packet to indicate that it is also done.
9. The client acknowledges the server's FIN.

Note that this is the best case. In the worst case, the client's request and FIN are
acknowledged separately, as are the server's reply and FIN.

* The central idea here is to modify the standard connection setup sequence slightly to
allow the transfer of data during setup.

* The T/TCP protocol is illustrated in Fig.(b). The client's first packet contains the SYN
bit, the request itself, and the FIN. When the server gets the request, it gives the reply
of Fig.(b), which says: I acknowledge your FIN, and I am done.

* The client then acknowledges the server's FIN and the protocol terminates in three
messages.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 201


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 202


10. THE APPLICATION LAYER

DNS (The Domain Name System):

* Programs could refer to hosts and other resources by their network IP addresses (Ex:
181.21.96.4), these addresses are hard for people to remember. So some mechanism is
required to convert these network (IP) addresses to names (ASCII strings) and vice
versa.

* In the ARPANET, there was simply a file, hosts.txt, that listed all the hosts and their
IP addresses. However, when thousands of PCs were connected to the net the size of
the file would become too large and it is impossible to maintain.

* More important, host name conflicts would occur constantly unless names were
centrally managed. To solve these problems, DNS (the Domain Name System) was
invented.

The essence of DNS is:

* A hierarchical, domain-based naming scheme and a distributed database system for


implementing this naming scheme.

* It is primarily used for mapping host names to IP addresses but can also be used for
other purposes. Below figure illustrates the functioning of DNS.

* Example: A user of an e-mail program may know the e-mail address of the recipient;
however, the IP protocol needs the IP address.

* The DNS client program sends a request to a DNS server to map the e-mail address to
the corresponding IP address.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 203


The DNS Name Space.

* Conceptually, the Internet is divided into over 200 top-level domains, where each
domain covers many hosts.

Fig. Internet Domain Name space

* Each domain is partitioned into subdomains, and these are further partitioned, and so
on.

All these domains can be represented by a tree, as shown in the figure. A leaf domain
represent a single host, or a company and contain thousands of hosts.

* The top-level domains come in two flavors: generic and countries. The original
generic domains were com (commercial), edu (educational institutions), gov
(government), int (certain international organizations), mil (military), net (network
providers), and org (nonprofit organizations).

* The country domains include one entry for every country for example: griet.ac.in. last
two characters (in) indicates India. Each domain is named by the path upward from it
to the (unnamed) root. The components are separated by periods (pronounced ''dot'').

Name server & Distribution of Name Space:

* It is very inefficient and also unreliable to store the entire, huge domain name space in
just one computer. It is inefficient because responding to requests from all over the
world places a heavy load on the system. It is not unreliable because any failure
makes the data inaccessible.

Hierarchy of Name Servers

* The solution to these problems is to distribute the information among many computers
called DNS servers. One way to do this is to divide the whole space into many
domains.

* Even these domains could be very large, so these domains are further divided into
smaller domains (sub domains).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 204


* Each server can be responsible (authoritative) for either a large or a small domain. In
other words, we have a hierarchy of servers in the same way that we have a hierarchy
of names as illustrated in the figure.

Zone

* Since the complete domain name hierarchy cannot be stored on a single server, it is
divided among many servers. What a server is responsible for or has authority over is
called a zone.

Primary and Secondary DNS Servers.

* DNS defines two types of servers: primary and secondary. A primary server is a
server that stores a file about the zone for which it is an authority. It is responsible for
creating, maintaining, and updating the zone file. It stores the zone file on a local disk.

* The secondary server neither create nor update zone file. It downloads information from
the primary server. The primary and secondary servers are both authoritative for the
zones they serve. If one server fails, the other can continue serving clients.

Resource Records.

* Every domain has a set of resource records associated with it. When a resolver gives a
domain name to DNS, what it gets back are the resource records associated with that
name. Thus, the primary function of DNS is to map domain names onto resource
records.

* A resource record is a five-tuple. Although they are encoded in binary for efficiency,
in most expositions, resource records are presented as ASCII text, one line per
resource record. The format we will use is as follows:

Domain_name Time_to_live Class Type Value

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 205


* The Domain_name tells the domain to which this record applies. This field the
primary search key used to satisfy queries.

* The Time_to_live field gives an indication of how stable the record is. Information
that is highly stable is assigned a large value, such as 86400 (the number of seconds in
1 day). Information that is highly volatile is assigned a small value, such as 60 (1
minute).

* Class: For Internet information, it is always IN. For non-Internet information, other
codes can be used, but in practice, these are rarely seen.

* Type field: The Type field tells what kind of record this is.

* Value: Gives the corresponding type value.

Fully Qualified Domain Name (FQDN):

* FQDN of a host in the DNS namespace hierarchy consists of all the labels from the
node, up to the root of the namespace, separated by periods (".").

* Fully Qualified Domain Name (FQDN) must end with a empty string, which
represents the Root. Since there is no need to represent empty string, Fully Qualified
Domain Name (FQDN) ends with a period (.).

* The trailing period (".") for the root domain is usually omitted in day to day use, but
the DNS Resolver (Client) and DNS Servers must use it during actual DNS name
queries. Ex: hostname: cse, domain name: griet.ac.in,

Example: FQDN : cse.griet.ac.in.  empty string after in. represents the root

Partially Qualified Domain Name (PQDN):

* A PQDN is used to specify a portion of a domain name, normally the host portion of
it. It starts with a host name, but it may not reach up to the root.

* Example of Partially Qualified Domain Name is cse. Usually the computers will add
the DNS suffix along with PQDN before sending a DNS query for name resolution.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 206


Electronic Mail.

Electronic mail allows a message to include text, audio, and video. It also allows one message
to be sent to one or more recipients.

Architecture:

The general architecture of an e-mail system includes three main components: a). User agent,
b). Message transfer agent, and c). Message access agent.

a). User Agent.

* User agent (UA) provides services to the user to make the process of sending and
receiving a message easier.

Services Provided by a User Agent

* A user agent is a software package (program) that composes, reads, replies to, and
forwards messages. It also handles mailboxes.

b). Message Transfer agent:

* In normal usage, the user agent builds a message and passes it to the message transfer
agent, which then uses some of the header fields to construct the actual envelope.

* The To: Address of the primary recipient(s). The Cc (Carbon copy): field gives the
addresses of any secondary recipients.

* The Bcc: (Blind carbon copy) field is like the Cc: field, except that this line is deleted
from all the copies sent to the primary and secondary recipients. This feature allows
people to send copies to third parties without the primary and secondary recipients
knowing this.

* From: / Sender : The next two fields, From: and Sender:, tell who wrote and sent the
message, respectively.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 207


MIME.

* Electronic mail has some limitations. For example, it cannot be used for languages
that are not supported by 7-bit ASCII characters (such as French, German, Russian
etc). Also, it cannot be used to send binary files or video or audio data.

* Multipurpose Internet Mail Extensions


(MIME) is a supplementary protocol
that allows non-ASCII data to be sent
through e-mail.

* MIME is a set of software functions


that transforms non-ASCII data
(stream of bits) to ASCII data and vice
versa.

* MIME defines 5 headers that can be


added to the original email header
section to define the transformation
parameters:

The MIME types and subtypes:

MIME version is currently 1.1.


MIME allows seven different types of data (five of those have
subtypes). Data types and subtypes in MIME:

Text: the original message is in 7-bit ASCII and no


transformation by MIME is needed.

Multipart: the body contains multiple, independent parts. Some


type of boundary is defined and this boundary is used to separate
the parts.

Encoding type: The next header defines the method used to


encode the messages into 0s and 1s for transport. Non ASCII
code to 7 bit NVT ASCII.

(NVT: network virtual terminal)

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 208


Message Transfer: The Simple Mail Transfer Protocol (SMTP):

* SMTP is a simple ASCII protocol. After establishing the TCP connection to port 25,
the sending machine (client), waits for the receiving machine (server) to talk first.

* If the server is willing to accept e-mail, the client announces whom the e-mail is
coming from and whom it is going to. If such a recipient exists at the destination, the
server gives the client the go-ahead to send the message.

* Then the client sends the message and the server acknowledges it. No checksums are
needed because TCP provides a reliable byte stream.

c). Message Access Agent (Final Delivery):

i). POP3 (Post Office Protocol Version 3):

* In internet message transfer agent on an ISP machine accept e-mail for its customers
and store it in their mailboxes (on an ISP machine). For this POP3 is used.

* POP3 protocol allows user transfer agents on client PCs to contact the message
transfer agent (on the ISP's machine) and allow e-mail to be copied from the ISP to
the user. The below figures illustrates this.

Fig.(a) Sending and


reading mail when the
receiver has a
permanent Internet
connection and the
user agent runs on the
same machine as the
message transfer
agent.

Fig.(b) Reading e-mail


when the receiver has
a dial-up connection to
an ISP.

* POP3 begins when the user starts the mail reader. The mail reader calls up the ISP
and establishes a TCP connection with the message transfer agent at port 110.

* Once the connection has been established, the POP3 protocol goes through three
states in sequence: Authorization, transactions and update.

* The authorization state deals with having the user log in.

* The transaction state deals with the user collecting the e-mails and marking them
for deletion from the mailbox.

* The update state actually causes the e-mails to be deleted.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 209


ii). IMAP (Internet Message Access Protocol).

* This disadvantage with POP3 is it basically assumes that the user will clear out the
mailbox on every contact and work off-line after that, so it deletes the messages from
the server.

* IMAP assumes that all the e-mail will remain on the server indefinitely in multiple
mailboxes. So it will not transfer messages to the user's computer for permanent
storage, rather stores on the server. IMAP provides mechanisms for creating,
destroying, and manipulating multiple mailboxes on the server.

* In this way a user can maintain a mailbox for each correspondent and move messages
there from the inbox after they have been read.

* Unlike POP3, IMAP can also accept outgoing e-mail for shipment to the destination
as well as deliver incoming e-mail

A comparison of POP3 and IMAP:

IMAP4 provides the following extra


functions:

* A user can check the e-mail


header prior to downloading.

* A user can search the contents


of the e-mail for a specific string of
characters prior to downloading.

* A user can partially download


e-mail. This is especially useful if
bandwidth is limited and the e-mail
contains multimedia with high
bandwidth requirements.

* A user can create, delete, or rename mailboxes on the mail server.

Web-Based Mail.

* In web based mail, instead of POP3 or IMAP4, HTTP is normally used.

* When the receiver needs to retrieve his e-mails, he sends a message to the website
(Gmail, yahoo, Hotmail).

* The website sends a form to be filled in, which includes the log-in name and the
password.

* If the log-in name and password match, the e-mail is transferred from the Web server
to receiver’s browser in HTML format.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 210


The World Wide Web:

* The World Wide Web (www) is an information space (repository) where documents
and other web resources are identified by URLs (Uniform Resource Locator),
interlinked by hypertext links, and can be accessed via the Internet.

* The World Wide Web was invented by Tim Berners-Lee in 1989. He wrote the first
web browser in 1990 while employed at CERN in Switzerland.

* Web pages are primarily text documents formatted and annotated with Hypertext
Markup Language (HTML). In addition to formatted text, web pages may contain
images, video, and software components.

Fig. The architecture of World Wide Web.

URL (Uniform Resource Locator):

* The URL is a standard for specifying any kind of information on the internet. It
defines four things. Protocol (method), Host , Port and method.

* A typical URL has three parts: the name of the protocol (http), the DNS name of the
machine where the page is located
(www.griet.ac.in), and (usually) the
name of the file containing the
page (csenotes.html).

http://www.griet.ac.in/courses.html

* The protocol (method) is the client/server program used to retrieve the document.
Many different protocols can retrieve a document; among them are FTP or HTTP.
The most common today is HTTP.
* The host is the computer on which the information is located.
* The URL can optionally contain the port number of the server.
* Path is the pathname of the file where the information is located.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 211


Functioning of a Web Browser:

* The following example demonstrates the functioning of a web browser when


accessing a page at the URL http://www. griet.ac.in/courses.html .

* The browser resolves the server name of the URL (www. griet.ac.in/courses.html)
into an Internet Protocol address using the globally distributed Domain Name System
(DNS). This lookup returns an IP address such as 203.0.113.4.

* The browser then requests the resource by sending an HTTP request across the
Internet to the computer at that address.

The Client Side:

For example let us take an URL : http://www.griet.ac.in/courses.html


When a user clicks on a hyperlink, the browser carries out a series of steps in order to fetch
the page pointed to. Let us trace the steps that occur when this link is selected.

i).The browser determines the URL (by seeing what was selected).
ii). The browser asks DNS for the IP address of www.griet.ac.in.
iii). DNS replies with 156.106.192.32.
iv). The browser makes a TCP connection to port 80 on 156.106.192.32.
v). It then sends over a request asking for file /courses/index.html.
vi). The www.itu.org server sends the file /courses/index.html.
vii). The TCP connection is released.
viii). The browser displays all the text in /courses/index.html.
ix). The browser fetches and displays all text or images in this file.

The Server Side:

Now let us take a look at the server side. As we saw above, when the user types in a URL or
clicks on a line of hypertext, the browser parses the URL and interprets the part between
http:// and the next slash as a DNS name to look up.

After fetching the IP address of the server, the browser establishes a TCP connection to port
80 on that server. Then it sends over a command containing the rest of the URL, which is the
name of a file on that server. The server then returns the file for the browser to display.

The steps that the server performs in its main loop are:

i). Accept a TCP connection from a client (a browser).


ii). Get the name of the file requested.
iii). Get the file (from disk).
iv). Return the file to the client.
v). Release the TCP connection.
vi). Modern Web servers have more features, but in essence, this is what a Web server does.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 212


Cookies:

A cookie is a small text file embedded in your hard drive by the server of the site you are
visiting. This file is neither a virus nor spyware.

Creation and Storage of Cookies.

1. When a server receives a request from a client, it stores information about the client in a
file or a string. The information includes the domain name of the client, the contents of the
cookie (information about the client such as name, registration number, and so on), a
timestamp, and other information depending on the implementation.

2. The server includes the cookie in the response that it sends to the client.

3. When the client receives the response, the browser stores the cookie in the cookie
directory.

Types of cookies: There are three different types of cookies:

i). Session cookies: these are mainly used by online shops and allow you to keep items in
your basket when shopping online. These cookies expire when the browser is closed.

ii). Permanent cookies: these remain in operation, even when you have closed the browser.
They remember your login details and password so you don’t have to type them in every time
you use the site. The law concerning permanent cookies stipulates that they need to be
deleted after a period of six months.

iii). Third-party cookies: these are installed by third parties with the aim of collecting
certain information to carry out various research into behaviour, demographics etc.

Advantages and disadvantages of cookies:

The above types of cookies helps the users to remember user information like login details or
other user data either by the server or system. This allows the user to save time and make the
things faster. But some third party cookies pose great security threat either by stealing and
selling the user information or by inserting harmful virus programs.

Solution: You can configure the browser to warn you each time a cookie is sent, letting you
decide whether to allow the cookie or not. This can be done manuaaly or by using special
software.

Erase cookies: Yes, Find the folder/file where cookies are stored on your computer and
delete them.

Block cookies: Configure your browser to categorically refuse all cookies that try to access
your computer. The only disadvantage of this option is that you will no longer be recognised
automatically and no longer able to shop online.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 213


HTML (The Hyper Text Markup Language):

HTML allows users to produce Web pages that include text, graphics, and pointers to other
Web pages. HTML is a markup language, a language for describing how documents are to be
formatted. Markup languages thus contain explicit commands for formatting.

For example, in HTML, <b> means start boldface mode, and </b> means leave boldface
mode. Other commands like <br> tag for line break.

<p> and </p> are start and end of paragraph, The <img> tag specifies that an image is to be
displayed at the current position in the page and <a> (anchor) and </a> tags for hyperlinks
etc. The browser simply understand the markup commands.

XML and XSL:

HTML, does not provide any structure to Web pages. It also mixes the content with the
formatting.

for example to analyze any item's title and price from many web pages, in HTML it is very
difficult. For this reason, the W3C has developed an enhancement to HTML to allow Web
pages to be structured for automated processing. Two new languages have been developed
for this purpose.

First, XML (eXtensible Markup Language) describes Web content in a structured way. XML
is a meta-language, allowing users to create any tags needed (hence "extensible") and then
describing those tags and their permitted uses

and second, XSL (eXtensible Style Language) describes the formatting independently of the
content.

XHTML:

XHTML (eXtended HyperText Markup Language) is essentially HTML 4 reformulated in


XML. One of the most noticeable differences between HTML and XHTML is the rule that all
tags must be closed: All tags and attributes must be in lower case. Tags like <HTML> (capital
letters) are not valid in XHTML. The use of tags like <html> is now mandatory.

In XHTML, all elements must be properly nested within each other, like this: <b><i>This
text is bold and italic</i></b>

XHTML Elements Must Always Be Closed: <p>This is another paragraph</p>

Empty Elements Must Also Be Closed: A break: <br />

XHTML Elements Must Be In Lower Case:


<body>
<p>This is a paragraph</p>
</body>

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 214


WEB DOCUMENTS

The documents in the WWW can be grouped into three broad categories:

i). Static,
ii). Dynamic,
iii). Active.

The category is based on the time at which the contents of the document are determined.

i). Static Documents

* Static documents are fixed-content documents that are created and stored in a server.
The client can get only a copy of the document and can be viewed using a browsing
program.

* The contents of the document can be changed in the server, but the user cannot
change them.

ii). Dynamic Documents

* A dynamic document is created by a Web server whenever a browser requests the


document.

* The Web server runs an application program or a script that creates the dynamic
document and returns the output of the program to the browser.

* A very simple example of a dynamic document is the retrieval of the time and date
from a server. Time and date are kinds of information that are dynamic in that they
change from moment to moment.

iii). Active Documents

* Active documents are the programs or a scripts run at the client site.

* For example, to run a program that creates animated graphics on the user screen a
browser requests an active document and the server sends a copy of the document or
a script. The document is then run at the client (browser) site.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 215


HTTP:

The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed,


collaborative systems. It is the foundation of data communication for the World Wide Web.
Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text.
HTTP is the protocol to exchange or transfer hypertext.

Request-response Protocol: HTTP functions as a request–response protocol in the client–


server computing model. A web browser, for example, may be the client and an application
running on a computer hosting a web site may be the server.

When the client submits an HTTP request, the server provides resources such as HTML files
and other content, completion status information about the request in its message body.

Connections

HTTP/1.1 is a revision of the original HTTP/1.0. Unlike HTTP/1.0, HTTP/1.1 can reuse a
connection multiple times to download images, scripts, stylesheets, etc after the page has
been delivered. It experiences less latency as the establishment of TCP connections presents
considerable overhead.

Request Methods

HTTP defines methods to indicate


the desired action to be performed
on the identified resource.

The HTTP/1.0 specification defined


the GET, POST and HEAD
methods and the HTTP/1.1
specification added 5 new methods: OPTIONS, PUT, DELETE, TRACE and CONNECT.

GET: Requests using GET should only retrieve data and should have no other effect.
HEAD: The HEAD method asks for a response identical to that of a GET request, but
without the response body.
POST: The POST method requests that the server accept the entity enclosed in the request as
a new subordinate of the web resource identified by the URI.

PUT: The PUT method requests that the enclosed entity be stored under the supplied URI.
DELETE: The DELETE method deletes the specified resource.
TRACE: The TRACE method echoes the received request so that a client can see what (if
any) changes or additions have been made by intermediate servers.
OPTIONS: The OPTIONS method returns the HTTP methods that the server supports for
the specified URL.
CONNECT: The CONNECT method converts the request connection to a transparent
TCP/IP tunnel, usually to facilitate SSL-encrypted communication (HTTPS) through an
unencrypted HTTP proxy.
PATCH: The PATCH method applies partial modifications to a resource.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 216


Performance Enhancements:

* To avoid frequently overloading and to improve the performance of Web various


techniques are developed. Some of them are:

i). Caching:

* Caching is a technique where pages are saved that has been requested in case they are
used again.

* To use caching, a browser can be configured to make all page requests to a proxy
instead of to the page's real server. If the proxy has the page, it returns the page
immediately. If not, it fetches the page from the server, adds it to the cache for future
use, and returns it to the client that requested it.

Hierarchical caching:

* Many ISPs also run proxies, in order to speed up access for all their customers. Often
all of these caches operate at the same time, so requests first go to the local proxy. If
that fails, the local proxy queries the LAN proxy. If that fails, the LAN proxy tries the
ISP proxy.

* The latter must succeed, either from its cache, a higher-level cache, or from the server
itself. A scheme involving multiple caches tried in sequence is called hierarchical
caching.

ii). Server replication (or mirroring):

* Caching is a client-side technique for improving performance, but server-side


techniques also exist. The most common approach that servers take to improve
performance is to replicate their contents at multiple, widely-separated locations.

* The user clicks to the nearest server. From then on, all requests go to the server
selected. Mirrored sites are generally completely static. The company decides where it
wants to place the mirrors, arranges for a server in each region, and puts more or less
the full content.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 217


iii). Content delivery networks (CDN):

* CDNs talk to content providers (music sites, newspapers, and others that want their
content easily and rapidly available) and offer to deliver their content to end users
efficiently for a fee. After the contract is signed, the content owner gives the CDN the
contents of its Web site for distribution. The figure illustrates how it operates.

Fig: Steps in CDN Access

WAP (The Wireless Application Protocol):

* A WAP device may be an enhanced mobile phone, PDA, or notebook computer


without any voice capability.

* The basic idea is to use the existing digital wireless infrastructure. Users can call up a
WAP gateway over the wireless link and send Web page requests to it. The below
figure illustrates the architecture of WAP.

Architecture of WAP:

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 218


* WAP is essentially a protocol stack for accessing the Web, but optimized for low-
bandwidth connections using wireless devices having a slow CPU, little memory, and
a small screen.

The layers in WAP protocol are shown below.

i). Bearers: The lowest layer supports all the existing mobile phone systems, including GSM,
D-AMPS, and CDMA. WAP 2 supports up to 384Kbps.

ii) WDP (Wireless Datagram Protocol): which is essentially UDP. The WDP allows WAP
to be bearer-independent by adapting the transport layer of the underlying bearer.

iii). WTLS (Wireless Transport Layer Security): an optional layer, provides a public-key
cryptography-based security mechanism similar to TLS.

Fig. The WAP protocol stack.

iv). WTP (Wireless Transaction Protocol) is a transaction layer, which manages requests
and responses, either reliably or unreliably.

* This layer replaces TCP, which is not used over the air link for efficiency reasons.

v). WSP (Wireless Session Protocol) Session layer, is similar to HTTP/1.1 but Unlike
HTTP, WSP has been designed to provide fast connection suspension and reconnection.

vi). Wireless Application Environment (WAE): WAP's does not use HTML. Instead, the
WAE layer uses a markup language called WML (Wireless Markup Language), which is an
application of XML.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 219


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 220


11. MULTIMEDIA

Introduction to digital audio:

* The frequency range of the human ear runs from 20 Hz to 20,000 Hz. The ear hears
logarithmically, so the ratio of two sounds with power A and B is conventionally
expressed in dB (decibels) according to the formula

dB=10 log10(A/B)

* Sound waves are in analog in nature. Audio waves can be converted to digital form by
an ADC (Analog Digital Converter) which generates a binary number as output.

(a) A sine wave. (b) Sampling the sine wave. (c) Quantizing the samples to 4 bits.

* To represent this signal digitally, we can sample it every T seconds, as shown by the
bar heights in fig b.

* If the highest frequency component present is f, then the Nyquist theorem states that
it is sufficient to make samples at a frequency 2f.

* Digital samples are never exact. The samples of Fig c, allow only nine values, from -
1.00 to +1.00 in steps of 0.25.

* An 8-bit sample would allow 256 distinct values. A 16-bit sample would allow 65,536
distinct values. The error introduced by the finite number of bits per sample is called
the quantization noise.

* If it is too large, the ear detects it. Audio CDs are digital with a sampling rate of
44,100 samples/sec of 16 bits each.

Bandwidth in Audio CDs = 44100 * 16 = 705600 = 705.6 kbps

Stereo = 705.6 * 2 = 1411200 = 1.411 Mbps

Audio compression:

* CD-quality audio requires a transmission bandwidth of 1.411 Mbps. Substantial


compression is needed to make transmission over the Internet practical. For this
reason, various audio compression algorithms (Ex: MP3) have been developed.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 221


Audio and Video compression

1. Audio Compression

Audio compression can be used for speech or music. For speech, we need to compress a 64-
kHz digitized signal; for music, we need to compress a 1.411 MHz signal. Two categories of
techniques are used for audio compression: predictive encoding and perceptual encoding.

a). Predictive Encoding

In predictive encoding, the differences between the samples are encoded instead of encoding
all the sampled values. This type of compression is normally used for speech.

Several standards have been defined such as GSM (13 kbps), G.729 (8 kbps), and G.723.3
(6.4 or 5.3 kbps).

b). Perceptual Encoding

The most common compression technique that is used to create CD-quality audio is based on
the perceptual encoding technique. This type of audio needs at least 1.411 Mbps; this cannot
be sent over the Internet without compression. MP3 standard uses this technique.

* Perceptual encoding is based on the science of psychoacoustics, which is the study of


how people perceive sound.

* The idea is based on flaws in our auditory system: Some sounds can mask other
sounds. Masking can happen in frequency and time.

* In frequency masking, a loud sound in a frequency range can partially or totally mask
a softer sound in another frequency range.

* For example, we cannot hear what our dance partner says in a room where a loud
heavy metal band is performing. In temporal masking, a loud sound can numb our
ears for a short time even after the sound has stopped.

* MP3 uses these two phenomena, frequency and temporal masking, to compress audio
signals. The technique analyzes and divides the spectrum into several groups.

* Zero bits are allocated to the frequency ranges that are totally masked. A small
number of bits are allocated to the frequency ranges that are partially masked. A
larger number of bits are allocated to the frequency ranges that are not masked.

* MP3 produces three data rates: 96 kbps, 128 kbps, and 160 kbps. The rate is based on
the range of the frequencies in the original analog audio.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 222


Streaming audio:

* Streaming audio is listening to sound over the Internet. When the user clicks on a
song. First the browser establish a TCP connection to the Web server to which the
song is hyperlinked.

* Next it sends a GET request in HTTP to request the song. Next, the server fetches the
song from the disk and sends it back to the browser.

* Using the MIME type, for example, audio/mp3, the browser saves the entire file as a
scratch file on the disk.

* Then it will start the associated media player and pass it the name of the scratch file.
The media player starts fetching and playing the music, block by block.

* The only trouble is that the entire song must be transmitted over the network before
the music starts. This delays the playing of the song.

* To get around this problem without changing how the browser works, music sites
links the file to the song title what is called a metafile.

rtsp://gsbr-audio-server/song-2013.mp3

* In most cases, the server named in the metafile is not the same as the Web server, but
a specialized media server. In this example, the media server uses RTSP (Real Time
Streaming Protocol), Instead of TCP it uses UDP for real time transmission.

* The media player buffers input from the media server and plays from the buffer rather
than directly from the network. In some cases, the music is interleaved (even/odd time
samples) to make error handling easier to do. Any transmission gaps are interpolated.

* With a push server, the media player sends a PLAY request and the server just keeps
pushing data at it. To avoid buffer under run and over run the media player defines a
low-water mark and a high-water mark in the buffer.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 223


Internet radio:

* There are two general approaches to Internet radio.

* In the first one, the programs are prerecorded and stored on disk. Listeners can
connect to the radio station's and pull up any program and download it for listening.

* The other approach is to broadcast live over the Internet. Some stations broadcast over
the air and over the Internet simultaneously.

Some of the key differences between the streaming audio and live Internet radio are:

1. Streaming audio can be pushed out at a rate greater than the playback rate since the
receiver can stop it when the high-water mark is hit. In contrast, live radio is always
broadcast at exactly the rate it is generated and played back.

2. Live radio station usually has hundreds of simultaneous listeners whereas streaming audio
is point to point. Under these circumstances, Internet radio should use multicasting with the
RTP/RTSP protocols.

* In current practice, TCP unicasting is used instead of RTP multicasting because few
ISPs support multicasting, so that is not a practical option.

* RTP is less well known than TCP, and not supported by all software packages.

* Most system administrators configure their firewall to protect their LAN from
unwelcome visitors. Almost everything else may be blocked, including RTP.

* These severe measures force multimedia applications into drastically less efficient
modes of operation.

* The main components include ordinary PC with a sound card and a microphone. The
software consists of a media player, such as Winamp or Freeamp, with a plug-in for
audio capture and a codec for the selected output format, for example, MP3 or Vorbis.

* The audio stream generated by the station is then fed over the Internet to a large
server, which handles distributing it to large numbers of TCP connections.

* The server typically supports many small stations.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 224


Voice Over IP (Internet telephony):

* One real-time interactive audio/video application is voice over IP, or Internet


telephony. The idea is to use the Internet as a telephone network with some additional
capabilities. Instead of communicating over a circuit-switched network, this
application allows communication between two parties over the packet-switched
Internet.

* Two protocols have been designed to handle this type of communication: SIP and
H.323. We briefly discuss both.

a). SIP

* The Session Initiation Protocol (SIP) is an application layer protocol that establishes,
manages, and terminates a multimedia session (call). It can be used to create two-
party, multiparty, or multicast sessions. SIP is designed to be independent of the
underlying transport layer; it can run on UDP, TCP, or SCTP.

Messages

* SIP is a text-based protocol, as is HTTP. SIP, like HTTP, uses messages. Six
messages are defined, as shown in the below figure.

* Each message has a header and a body. The header consists of several lines that
describe the structure of the message, caller's capability, media type, and so on.

* The caller initializes a session with the INVITE message. After the callee answers the
call, the caller sends an ACK message for confirmation. The BYE message terminates
a session.

* The OPTIONS message queries a machine about its capabilities. The CANCEL
message cancels an already started initialization process. The REGISTER message
makes a connection when the callee is not available.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 225


Addresses: (Formats)

* In a regular telephone communication, a telephone number identifies the sender, and


another telephone number identifies the receiver. In SIP, an e-mail address, an IP
address, a telephone number, and other types of addresses can be used to identify the
sender and receiver.

The address needs to be in SIP format (also called scheme) are shown in the below figure.

Simple Session

A simple session using SIP consists of three


modules: establishing, communicating, and
terminating. Below figure shows a simple session
using SIP.

Establishing a Session Establishing a session in


SIP requires a three-way handshake.

The caller sends an INVITE message, using


UDP, TCP, or SCTP to begin the communication.
If the callee is willing to start the session, she sends a reply message. To confirm that a reply
code has been received, the caller sends an ACK message.

Communicating After the session has been established, the caller and the callee can
communicate by using two temporary ports. The session can be terminated with a BYE
message sent by either party.

Tracking the Callee

SIP has a mechanism (similar to one


in DNS) that finds the IP address of
the terminal at the callee. To perform
this tracking, SIP uses the concept of
registration.

SIP defines some servers as registrars.


At any moment a user is registered
with at least one registrar server; this
server knows the IP address of the
callee.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 226


b). H.323

H.323 is a standard designed to allow telephones on the public telephone network to talk to
computers (called terminals in H.323) connected to the Internet.

A gateway connects the Internet to the telephone network.

In general, a gateway is a five-layer


device that can translate a message
from one protocol stack to another.

The gateway transforms a telephone


network message to an Internet
message. The gatekeeper server on the
local area network plays the role of the registrar server.

Protocols

H.323 uses G.71 or G.723.1 for compression.


It uses a protocol named H.245 which allows
the parties to negotiate the compression
method.

Protocol Q.931 is used .for establishing and


terminating connections. Another protocol
called H.225, or RAS (Registration /Administration / Status), is used for registration with the
gatekeeper.

Operation

The operation of a telephone


communication using H.323 is as
follows.

1. The terminal sends a broadcast


message to the gatekeeper. The
gatekeeper responds with its IP address.

2. Use H.225 to negotiate bandwidth.

3. The terminal, gatekeeper, gateway, and


telephone communicate by using Q.931
to set up a connection.

4. Communicate by using H.245 to


negotiate the compression method.

5. The terminal, gateway, and telephone exchange audio by using RTP under the
management of RTCP and communicate by using Q.931 to terminate the communication.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 227


Introduction to video:- Video Compression:

Video is composed of multiple frames. Each frame is one image. We can compress video by
first compressing images. Two standards are prevalent in the market.

i). Joint Photographic Experts Group (JPEG) is used to compress images.


ii). Moving Picture Experts Group (MPEG) is used to compress video.

i). Joint Photographic Experts Group (JPEG):

In a gray scale image each pixel is represented by an 8-bit integer (256 levels). In case of
color image, each pixel is represented by 24 bits (3 x 8 bits), with each 8 bits representing
red, blue, or green (RBG).

In JPEG, a gray scale picture is divided into blocks of 8 x 8 pixels as shown below.

The purpose of dividing the picture into blocks is to decrease the number of calculations. The
whole idea of JPEG is to change the picture into a linear (vector) set of numbers that reveals
the redundancies, which can then be removed by using one of the text compression methods.
as shown in the below figure.

a). Discrete Cosine Transform (DCT) : In this step, each block of 64 pixels goes through a
transformation changes of the 64 values so that the relative relationships between pixels are
kept but the redundancies are revealed.

b). Quantization: Quantization reduces the number of bits needed for encoding. Each
number is divided by a constant and the fraction is dropped. This reduces the required
number of bits.

We lose some information here that is not recoverable. That is


why JPEG is called lossy compression.

c). Compression: After quantization, the values are read from


the table, and redundant 0s are removed. However, to cluster
the 0s together, the table is read diagonally in a zigzag fashion
rather than row by row or column by column. The reason is that
if the picture changes smoothly, the bottom right corner of the T
table is all 0s. Below figure shows the process.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 228


ii). The MPEG Standard.

The Moving Picture Experts Group (MPEG) method is used to compress video. In principle,
a motion picture is a rapid flow of a set of frames, where each frame is an image.

* In other words, a frame is a spatial combination of pixels, and a video is a temporal


combination of frames that are sent one after another.

* Compressing video, then, means spatially compressing each frame and temporally
compressing a set of frames.

a). Spatial Compression: The spatial compression of each frame is done with JPEG (or a
modification of it). Each frame is a picture that can be independently compressed.

b). Temporal Compression: In temporal compression, redundant frames are removed. For
example, when someone is talking, most of the frame is the same as the previous one except
for the segment of the frame around the lips, which changes from one frame to another.

To temporally compress data, the MPEG method first divides frames into three categories:
I-frames, P-frames, and B-frames.

I-frames: An intracoded frame (I-frame) is an independent frame. They are present at


regular intervals to handle some sudden change in the frame that the previous and following
frames cannot show.

P-frames: A predicted frame (P-frame) is related to the preceding I-frame or P-frame. In


other words, each P-frame contains only the changes from the preceding frame. The changes,
however, cannot cover a big segment. P-frames carry much less information than other frame
types and carry even fewer bits after compression.

B-frames: A bidirectional frame (B-frame) is related to the preceding and following I-frame
or P-frame. In other words, each B-frame is relative to the past and the future.

D-frames are only used to make it possible to display a low-resolution image when doing a
rewind or fast forward.

The D-frames are used to produce low-resolution images. Each D-frame entry is just the
average value of one block, with no further encoding, making it easy to display in real time.

MPEG Frame construction:

I, P, and B-frames are constructed from a series of seven frames.


MPEG has gone through two versions. MPEG1 was designed for a
CD-ROM with a data rate of 1.5 Mbps. MPEG2 was designed for
high-quality DVD with a data rate of 3 to 6 Mbps.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 229


Video on demand:

* Overview of a video-on-demand system is illustrated in the below Fig.

* Here a high-bandwidth wide area backbone network is used at the center of the
system. Connected to it are thousands of local distribution networks.

* The local distribution systems reach into people's houses, where they terminate in set-
top boxes, which are, in fact, powerful, specialized personal computers.

Video Servers:

* Video servers are capable of storing and outputting a large number of movies
simultaneously. The cheapest way to store large volumes of information is on
magnetic tape.

* The problem with these systems is the access time, the transfer rate, and the limited
number of tape drives (to serve n movies at once, the unit would need n drives).

* The server has one or more high-performance CPUs, each with some local memory, a
shared main memory, a massive RAM cache for popular movies, a variety of storage
devices for holding the movies, and some networking hardware, normally an optical
interface to a SONET or ATM backbone at OC-12 or higher.

Local spooling servers:

* Allow videos to be placed closer to the users (in advance), to save bandwidth during
peak hours.

The Distribution Network

* The distribution network is the set of switches and lines between the source and
destination. It consists of a backbone, connected to a local distribution network.

* Usually, the backbone is switched and the local distribution network is not. The main
requirement imposed on the backbone is high bandwidth.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 230


The MBone (The Multicast Backbone):

* MBone is a virtual overlay network on top of the Internet. It consists of multicast-


capable islands connected by tunnels, as shown in the below Fig.

* MBone consists of six islands, A through F, connected by seven tunnels. Each island
supports hardware multicast to its hosts. The tunnels propagate MBone packets
between the islands.

* Each island contains one or more special routers called mrouters (multicast routers).
logically connected by tunnels.

* MBone packets are encapsulated within IP packets and sent as regular unicast packets
to the destination mrouter's IP address.

* When a new island appears such as G, its administrator sends a message


announcing its existence the nearby sites then contact him to arrange to set up tunnels.

* Tunnels are defined by tables in the mrouters and can be added, deleted, or moved
simply by changing these tables.

* MBone use DVMRP (Distance Vector Multicast Routing Protocol).

* To multicast an audio or video program, a source must first acquire a class D


multicast address, which acts like a station frequency or channel number.

* Many multicasts may be going on at once, and a host can ''tune'' to the one it is
interested in by listening to the appropriate multicast address.

* Each mrouter keeps a table of which channels it must put out onto its LAN, to avoid
wasting bandwidth by multicasting channels that nobody wants.

* Multicasts propagate through MBone as follows. When an audio or video source


generates a new packet, it multicasts it to its local island. This packet is picked up by
the local mrouter, which then copies it into all the tunnels to which it is connected.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 231


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 232


12. CRYPTOGRAPHY

Cryptography: Cryptography, a word with Greek origins, means "secret writing." Today it
is the science and art of transforming messages to make them secure and immune to attacks.

Plaintext: The original message, before


being transformed, is called plaintext.

Ciphertext: After the message is


transformed, it is called ciphertext.

* An encryption algorithm from the sender side, transforms the plaintext into ciphertext;
To encrypt a message, we need an encryption algorithm, an encryption key, and the
plaintext. These create the ciphertext.

* A decryption algorithm at the receiver side transforms the ciphertext back into
plaintext. To decrypt a message, we need a decryption algorithm, a decryption key,
and the ciphertext. These reveal the original plaintext.

Cipher: We refer to encryption and decryption algorithms as ciphers. The term cipher is also
used to refer to different categories of algorithms in cryptography.

Key: A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on.

Two Categories of cryptography.

i). Symmetric key (secret-key) cryptography algorithms.


ii). Asymmetric key (public-key) cryptography algorithms.

i). In Symmetric-Key Cryptography, the same key is used by both parties.

* The sender uses this key and


an encryption algorithm to encrypt
data; the receiver uses the same key
and the corresponding decryption
algorithm to decrypt the data.

ii). Asymmetric-Key Cryptography, there are two keys: a private key and a public key.

* The private key is kept by the receiver. The public key is announced to the public.

* In public-key encryption
/decryption, the public key is used for
encryption and the private key that is
used for decryption.

* The public key is available to the public and the private key is available only to an
individual.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 233


Symmetric key cryptography:

* Symmetric-key cryptography is mainly used in our network security. The earlier


traditional ciphers are character oriented, whereas the modern ciphers are bit
oriented.

i). Traditional Ciphers (encryption methods)


have been divided into two categories:

a). Substitution ciphers and


b). Transposition ciphers.

a). Substitution ciphers:

* A substitution cipher substitutes one symbol with another. If the symbols in the
plaintext are alphabetic characters, they are replaced with another character, if they
are numbers they are replaced with another numbers.

* Substitution ciphers can be categorized as either monoalphabetic or polyalphabetic


ciphers.

i). Monoalphabetic ciphers:

* In a monoalphabetic cipher, a character (or a symbol) in the plaintext is always


changed to the same character (or symbol) in the ciphertext regardless of its position
in the text.

For example, if the algorithm says that character A in the plaintext is changed to character D,
every character A is changed to character D. In other words, the relationship between
characters in the plaintext and the ciphertext is a one-to-one relationship.

Ex: Plain Text :HELLO


Cipher Text :KHOOR

ii). Polyalphabetic ciphers:

* In a polyalphabetic cipher, each occurrence of a character can have a different


substitute. The relationship between a character in the plaintext to a character in the
ciphertext is a one-to-many relationship.

For example, character A could be changed to D in the beginning of the text, but it could be
changed to N at the middle.

To achieve this goal, we need to divide the text into groups of characters and use a set of
keys. The key must tell us which of the many possible characters can be chosen for
encryption.

For example, we can divide the text "THISISANEASYTASK" into groups of 3 characters
and then apply the encryption using a set of 3 keys. We then repeat the procedure for the next
3 characters. (for every three characters use one different shift cipher).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 234


iii). Shift cipher (Caesar cipher):

* The simplest monoalphabetic cipher is probably the shift cipher. We assume that the
plaintext and ciphertext consist of uppercase letters (A to Z) only.

* In this cipher, the encryption algorithm is "shift key characters down," with key equal
to some number. The decryption algorithm is "shift key characters up."

* For example, if the key is 3, the encryption algorithm is "shift 3 characters down"
(toward the end of the alphabet). The decryption algorithm is "shift 3 characters up"
(toward the beginning of the alphabet).

Ex: message (Plain Text) = “abcd” after encryption using shift 3 characters up
(Cipher Text) = “defg” (d = a shift 3 characters)

b). Transposition Ciphers:

* In a transposition cipher, there is no substitution of characters; instead, their locations


change.

* A character in the first position of the plaintext may appear in the tenth position of the
ciphertext. A character in the eighth position may appear in the first position. In other
words, a transposition cipher reorders the symbols in a block of symbols.

Key: In a transposition cipher, the key is a mapping between the position of the symbols in
the plaintext and cipher text.

For example, the following


shows the key using a block
of four characters:

Plaintext: 2413
Ciphertext: 1234

Ex: Encrypt the message "HELLO MY DEAR," using the above key.

Solution: We first remove the spaces in the message. We then divide the text into blocks of
four characters. We add a bogus character Z at the end of the third block.

The result is HELL OMYD EARZ. We create a three-block ciphertext ELHLMDOYAZER.

Decrypt: After removing the bogus character and combining the characters, we get the
original message "HELLO MY DEAR."

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 235


* Traditional algorithms, were character-oriented. However, modern bit-oriented
ciphers are much more complex.

Example: Transposition ciphers, reorder the letters but do not disguise them. Below figure
depicts a common transposition cipher, the columnar transposition. The cipher is keyed by a
word or phrase not containing any repeated letters.

* In this example, MEGABUCK is the key.

* The purpose of the key is to number the columns, column 1 being under the key letter
closest to the start of the alphabet, and so on.

* The plaintext is written horizontally, in rows, padded to fill the matrix if need be.

* The ciphertext is read out by columns, starting with the column whose key letter is the
lowest.

One time Pads (XOR Cipher):

This method is also called as XOR cipher because it uses the exclusive - OR operation.

* An XOR operation needs two data inputs. First, take the plaintext. Then convert the
plaintext into a bit string, and then choose a random bit string as the key.

* In other words, one of the inputs is the block to be the encrypted, the other input is a
key and the result is the encrypted block.

* Now compute the XOR (exclusive OR) of these two strings, bit by bit. The size of
both the key, the plaintext, and the ciphertext are all the same. XOR ciphers have a
very interesting property: the encryption and decryption are the same.

* This method, known as the one-time pad, is immune to all present and future attacks
no matter how much computational power the intruder has.

* The reason is there is no information in the message because all possible plaintexts of
the given length are equally likely.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 236


Quantum cryptography:

* Quantum cryptography is based on the fact that light comes in little packets called
photons, light can be polarized by being passed through a polarizing filter.

* If a beam of light is passed through a polarizing filter, all the photons emerging from
it will be polarized in the direction of the filter's axis (e.g., vertical).

To generate a one-time pad, Alice needs two sets of polarizing filters.

i). Set one consists of a vertical filter and a horizontal filter (rectilinear basis).

ii). The second set of filters is the same, except rotated 45 degrees (diagonal basis).

* Instead of four filters a crystal is used, whose polarization can be switched electrically
to any of the four allowed directions at great speed.

* Bob has the same equipment as Alice. Both have two bases, essential to quantum
cryptography.

* For each basis, Alice now assigns one direction as 0 for vertical and the other as 1 for
horizontal.

Also, she chooses lower left to upper right as 0 and upper left to lower right as 1. She sends
these choices to Bob as plain text.

Bob picks one base at random


for each arriving photon and
just uses it, as shown in
Fig.(b).

If he picks the correct basis, he


gets the correct bit. If he picks
the incorrect basis, he gets a
random bit because of a
polarization properties of the
photon.

Thus, some of the bits are


correct and some are random,
as shown in Fig. (c).

Now Bob tells Alice which basis he used for each bit and she tells him which are right and
which are wrong, as shown in Fig.(d). From this information both of them can build a bit
string from the correct guesses, as shown in Fig. (e).

On the average, this bit string will be half the length of the original bit string, but since both
parties know it, they can use it as a one-time pad. Although quantum cryptography has been
shown to operate over distances of 60 km of fiber, the equipment is complex and expensive.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 237


Two Fundamental Cryptographic Principles:

i). Redundancy:

Redundancy is a process of adding unwanted bits to the original data. In quantum


cryptography, we can see how redundancy plays a role there.

One very crude form of redundancy is repeating the message two times. If the two copies are
not identical, the receiver knows that either the fiber is very noisy or someone is tampering
with the transmission.

Sending everything twice is excessive; But it should be clear that some redundancy is needed
to distinguish a valid message from an invalid message, especially in the face of an active
intruder.

ii). Freshness:

The second cryptographic principle is that some measures must be taken to ensure that each
message received can be verified as being fresh, that is, sent very recently.

One such measure is including in every message a timestamp valid only for, say, 10 seconds.
The receiver can then just keep the messages around for 10 seconds, to compare newly
arrived messages to previous ones to filter out duplicates.

Messages older than 10 seconds can be thrown out, since any replies sent more than 10
seconds later will be rejected as too old. Measures other than timestamps will be discussed
later.

For any suggestions / comments please write to: gsbapiraju@gmail.com

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 238


QUESTION BANK
(For GR15 A2077 regulation).

QUESTION BANK is a hoard of questions, collected from various university semester end
question papers. The number in the third column of the below tables indicates the page
number(s) where the answers are located.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 239


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 240


Chapter 01: 1. INTRODUCTION TO NETWORKS AND MODELS

S.No Questions Page No


What are the different goals and applications of networking?
1 Give five reasons of how networks are a part of our life? 1
Discuss various network applications and goals in detail.
Explain PEER to PEER Networking * Define the following terms:
2 Computer Network, Peer process, Protocol, Interface. 2
Write short notes on (a) Client server model
Explain about LAN, MAN, WAN. * Differentiate among LAN, MAN and
WAN in terms of topology and technology used by each network.
Explain about metropolitan area networks (MANs). * What are the distinct
3 4
characteristics of local area networks, explain briefly? * Why is a LAN
required and what objectives are achieved by having a LAN * What are the
various types of computer networks? * Describe Wide Area Networks.
Differentiate between connection oriented and connection less service.
What is the principle difference between CO communication and CL
communication. Explain * Compare connection less and connection oriented
4 5
services with suitable examples? * Network layer can provide either
connection oriented service or connection less service. Which one you
prefer. Justify your answer.
Discuss various network topologies suitable for a particular type of a
5 6
computer network?
Write any four reasons for using layered protocols.
6 7
What are the advantages of having layered architecture?
Explain with the help of a diagram the Layered Architecture of OSI
Reference Model. * Explain about OSI Reference Model with a neat
7 diagram.* Differentiate between OSI reference model and TCP/IP model 8
with neat diagrams. * Mention the layers of ISO-OSI reference model?
Describe the main functionality of the session layer.
Illustrate simplex, half-duplex and full duplex modes. What mode is used
when two people are communicated by a telephone line? * Give an example
8 9
where we require: Simplex communication Half duplex communication
Full duplex communication.
9 Draw the layer diagram of TCP/IP protocol suit and explain it briefly. 10
List two ways in which the OSI reference model and the TCP/IP reference
model are the same and list in which they differ. * Compare and contrast the
10 11
OSI and TCP/IP reference models. * Differentiate between OSI reference
model and TCP/IP model with neat diagrams.
11 Write short notes on the following: * MAN * Interfaces and services. 12
Give a detailed description of the Novell Netware reference model.
12 Explain Novell NetWare Reference model. * Give a detailed description of 13
the Novell Netware IPX packet?
Write short notes on ARPANET. * Discuss the growth of ARPANET
13 14
briefly.
14 What is the Internet? Mention some of the applications of Internet? 15
With a neat diagram, explain ATM cell header format. * Explain PVC and
15 SVC virtual circuits in ATM 17

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 241


Draw the ATM protocol model and describe the functions performed by
16 18
each layer. * Explain about ATM reference model.
17 Briefly discuss the differences between various AAL protocols. 19
18 What are ATM Service categories. 20
Why does ATM use small and fixed length cells? * How does Internet differ
from WAN? * How would you utilize an existing telephone network for
Computer to Computer data communications? * What is the relationship
19 between telecommunications and data communications? Is one a ***
subset of other? Give reasons for your answers? * How does a virtual
circuit differ from a physical circuit? What advantages would a virtual
circuit provide?

*** In class activity.

Chapter 02: 2. THE PHYSICAL LAYER.

S.No Questions Page No


Discuss about guided and unguided transmission media. * Discuss
20 about the various transmission media available at the physical 21
layer?
What is the significance of twisting in twisted pair cable? What are the
21 22
different categories of a twisted pair cable and their features. * Explain the
characteristics of twisted pair cable.
22 Describe the characteristics of broadband co-axial cable. 23

23 Differentiate between the following: bit rate and baud rate single mode 24
fiber and multi mode fiber.
24 Write the advantages of optical fiber over twisted-pair and coaxial cables. 26

What is the need for wireless communication? Discuss about various


25 portions of spectrum used for transmitting information? * Discuss about 27
the electromagnetic spectrum and its uses for communication?
26 Write a brief notes on: i. Radio transmission ii. Microwave transmission 28

27 Explain GEO, MEO and LEO and their applications


30
28 Discuss Signaling and Traffic Control in Telephone Network. 34
29 What is multiplexing? How does frequency division multiplexing work? 35
30 Explain the working of the Synchronous Time Division Multiplexing.
39
What is channelization? Define Time Division Multiple Access?
Write the differences between message switching and packet switching.
Explain in detail Circuit and Message Switching. * Discuss circuit
31 switching and packet switching methods. Also discuss their merits 41
and demerits * Which switching method allows real-time data transfer?
Mention the advantages of packet switching?

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 242


32 Explain frequency reuse principle. 44
33 Explain handoff and its types? Where and why it is used? 48

Chapter 03: 3. DATALINK LAYER

S.No Questions Page No


Explain the design issues of data link layer.
34 List and explain the services provided by data link layer 51
Discuss the basic functions of data link layer in brief?
Discuss the services provided by the data link layer to the network layer?
35 Explain the following terms related to the data link layer 52,54
i). Framing, ii). Error control, iii). Flow control.
36 A bit string, 0111101111101111110, needs to be transmitted at the data 53
link layer. What is the string actually transmitted after bit stuffing?
37 Compare and contrast flow control and error control. 54

38 What is flow control? Why is essential at the data link layer? Mention few 55
techniques for the same?
What are the different types of error detection methods? Explain the CRC
39 error detection technique using generator polynomial x4+x3+1 and data 57
11100011.
40 Explain any two elementary data link protocols. 61

Explain the sliding window protocol with a neat sketch?


41 Explain about the Sliding Window Protocols. 62
Explain how the band width wastage is reduced in case of sliding window
protocol with selective repeat?
Explain one bit sliding window protocol. Give the advantages and
42 disadvantages of one-bit sliding window protocol? * Describe the stop 63
and wait flow control technique. * Discuss the error control technique
which is commonly used in data network.
Two approaches can be used for ordering of packets, buffering all the
43 packets at the receiver and then reordering them or receiver accepts only 64,65
packets in order and sender retransmits packets if necessary. Compare
these two approaches.
Explain how the band width wastage is reduced in case of sliding window
44 protocol with selective repeat? * Explain the term sliding window. Also 65
illustrate and explain the operation of selective repeat. * Draw a basic
block diagram of ARQ and explain Selective Repeat ARQ Method.
45 Define piggybacking and write its uses. 66

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 243


Chapter 04: 4. MEDIA ACCESS SUBLAYER

S.No Questions Page No


Describe the static channel allocation in LANs and MANs.
46 Explain about the Dynamic Channel Allocation.
67
Discuss about the file key assumptions in case of dynamic channel
allocation in LANs and WANs?
47 Explain in detail the operation of slotted ALOHA.
68
Give a brief note on the following protocols ALOHA
Explain about CSMA strategies.
48 Explain the following CSMA schemes: (i) Non-persistent, (ii) 1-persistent 73
(iii) p-persistent.
Explain any two protocols that resolve the contention for the channel with
49 out any collisions at all? * Explain Bit-Map and Binary Countdown
77, 78
collision-free protocols. * Compare the two basic scheduling approaches
in Medium Access Control.
50 Discuss in detail about IEEE 802.x Ethernet 83
Explain MAC sub layer functions.
51 Discuss about fast Ethernet cabling? 86
52 Sketch the Manchester encoding for the bit stream: 0001110101. 87

Discuss with the help of a figure the frame structure of IEEE 802.3.
53 Explain 802.3 frame format with a neat sketch 88
Discuss in brief MAC frame structure for IEEE 802.3?

Chapter 05: 5. IEEE 802.11

S.No Questions Page No


Explain the protocol stack in Bluetooth
54 Bluetooth Architecture 103, 104
Frame structure of 802.15.1
Write briefly on: Bridges, Data link layer
Compare and contrast Transparent and Source routing bridges.
Explain the functions of repeaters and bridges. What are their limitations? 107,112
55
What is the relationship between a switch and bridge?
What are the different types of networking / internetworking devices ?
Discuss them.
Explain the features and advantages of VLAN 114
56
Consider an environment in which probability of errors is high. What
57 should be packet size in such an environment, Large/ Small? Justify your ***
selection.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 244


Chapter 06: 6. NETWORK LAYER

S.No Questions Page No


Briefly explain the Network Layer design issues.
58 What are the services provided by Network layer to Transport layer. 117
Explain.* Discuss in detail about Network Layer in Internet. * Discuss
about the role of network layer in internet.
What is a Datagram Network and how it is different from Packet
59 Switching? Explain Datagram Network having four Switches. How 118
routing table is maintained in this network?
Discuss the trade-offs between the Virtual Circuit and Datagram Subnets.
Compare virtual circuit and datagram subnets. * Define Virtual circuit and
60 Datagram. * Compare Virtual circuit subnet with Datagram Subnet. Is 119
Virtual circuit same as Physical connection. Comment.

Routing can be classified in to two types Source routing and hop-by-hop


routing. In source routing, source determines the complete route, places
the route in the packet header and intermediate routers just switch packets
61 from one link to other link. In hop-by-hop routing each router maintains a 119
routing table and when packet arrives on input link it places it on output
link based on routing table. Compare the relative advantages &
disadvantages of these two routing approaches.
What are the advantages of adaptive routing approach over non adaptive
62 routing. * What is non- adaptive routing. Explain any two non- adaptive 120
routing algorithms. * Differentiate between adaptive and non - adaptive
routing algorithms. * Discuss the various goals of routing algorithms?
What is Optimality Principle? Explain about
Dijkstra’s shortest path routing algorithm with
63 example. a) Explain Dijkstra’s shortest path 120,121
algorithm. (b) Consider graph given figure 5b.
Compute the shortest path from A to D.
64 Distinguish between flooding and broadcast. How selective flooding is 122,123
used to control flooding. Where flooding is used and why.
Explain the working of Distance vector routing algorithm with the help of
65 125
an example. * What is Count to Infinity problem? Suggest solution for it.
Explain the distributed Bellman-Ford routing algorithm
66 Describe any two Internet Routing Protocols in detail. 125,128
Describe route discovery in detail.
67 Explain link state routing. How it is different from distance vector routing 128

How hierarchical routing reduces the size of Routing Table?


* Consider an organization which has several branches in different cities
68 129
of India. * How hierarchical routing can be used for routing in such an
organization. * How hierarchical routing reduces the size of Routing
Table? * Give the advantages of hierarchical routing.
Differentiate between unicast , multicast and broad cast.
69 What is Multicasting. How it is different from broadcasting. How do you 131
construct a multicast tree. Explain with an example. * What are the
applications of multicasting.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 245


70 Explain routing in mobile hosts. 132

71 Explain how route is discovered using AODV routing algorithm 133

Chapter 07: 7. CONGESTION CONTROL

S.No Questions Page No


b) What is congestion? Why does it happen? List all its factors and
72 explain. * What is congestion control and how it is implemented in 135
Network Layer * Explain how flow control is different from congestion
control.
73 Give the general principles of various congestion control algorithms. 136
Explain any algorithm for congestion avoidance.
74 Explain the congestion prevention policies at various levels. 137

75 How congestion is controlled in virtual subnetworks. 139

Explain the following: Warning bit, choke packets, RED. * What is the
76 role of Choke packet in managing congestion? * (a) Explain Load 140
shedding for congestion control.
77 Why it is important to control jitter for Audio and Video applications? 141

78 Explain QoS in network layer 142

79 Explain briefly the techniques used to improve QoS. 143

What is traffic shaping? Briefly explain the two techniques of traffic


80 shaping. * How leaky bucket algorithm helps in traffic shaping? * 144
Explain the working of token bucket algorithm. * Compare Leaky
bucket and Token bucket algorithms for traffic shaping.
Routing can be classified in to two types Source routing and hop-by-hop
routing. In source routing, source determines the complete route, places
the route in the packet header and intermediate routers just switch packets
81 from one link to other link. In hop-by-hop routing each router maintains a ***
routing table and when packet arrives on input link it places it on output
link based on routing table. Compare the relative advantages &
disadvantages of these two routing approaches.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 246


Chapter 08: 8. THE NETWORK LAYER IN THE INTERNET

S.No Questions Page No


82 Explain the classes in IP address, how they are classified. 152

83 Explain Special IP address and Subnets. 152

84 What are the differences between classfull addressing and classless


154
addressing in IPv4. Explain classless inter domain routing (CIDR).
85 Briefly explain the operation of NAT 155
86 Explain ICMP 157
What is Logical address and Physical address in computer networks? Why
87 a mapping from logical address to physical address and vice versa is 160
required? Explain the protocols which perform it. (ARP and RARP)
88 Explain Dynamic Host Control Protocol. 162

89 Explain Autonomous system, Intra and inter domain system 163

90 Explain Routing information protocol (RIP). 165

91 Explain the Open Shortest Path First (OSPF) routing protocol. 166

92 Explain Path vector routing (Inter domain routing). 168


Explain inter domain (or exterior) routing protocol in detail (BGP).
93 What is the significance of home agent and Foreign agent in routing for 171
mobile hosts? Why tunneling is used for routing in mobile hosts?
94 With neat diagram explain IPv4 header format. 172

95 Explain IPv6 format in detail 174

96 What are the major differences between IPv4 and IPv6? Discuss header 175
format and Network Addressing with reference to IPv6.

Chapter 09: 9. THE TRANSPORT LAYER

S.No Questions Page No


97 Explain the service primitives of Transport Layer. 179

98 List and explain the socket primitives used in Berkeley UNIX for TCP. 181

Briefly explain the concept of Addressing in TL.


99 Explain addressing at Transport layer? 182
Briefly explain the elements of the transport protocols.
100 Explain the protocol scenarios for establishing a connection using three 183
way handshake.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 247


101 Why abrupt connection release results in data loss? 184

102 Explain the following with reference to Transport layer: (a) Flow control 185
(b) Buffering * Explain the flow control mechanism in transport layer.
103 What is multiplexing? Why multiplexing is required? What is the 186
difference between upward multiplexing and downward multiplexing?
How to recover from host crashes and router crashes? * How are
104 connection establishment and crash recovery managed at the transport 187
layer? Explain.
Why does UDP exist? Explain the features of UDP. * Define UDP and
105 discuss the different fields of the format of a used datagram? Also, list 188
some of the uses of the UDP protocol?
106 Explain the features of TCP Protocol. (services) 192
Define TCP and discuss the different fields of TCP packet format with the
help of a Diagram. * List the fields in the TCP header that are missing
107 193
from UDP header. Give the reason for their absence. * Briefly describe the
use of each field of TCP header.
Compare and contrast internet transport protocols TCP and UDP.
Explain about TCP and UDP Protocols.* Why TCP is not suitable for 187,193
108
request, reply type of transfers? As application developer under what
circumstances you use TCP and under what circumstances you use UDP?
In TCP Why three way handshake is required for connection 195
109
establishment and release.

110 Explain about the Connection Management in Transport Layer.


196
Explain window management in TCP with the help of an example.
111 Explain transmission policy in TCP. 198

What is the role played by threshold value in congestion control?


Assume network with links having abundant bandwidth. What are the pros
112 199
and cons of using exponential increase and linear increase of congestion
window? What happens if bandwidth is limited? * Explain how TCP
controls congestion?
113 Explain any two techniques used in wireless TCP. (Indirect and 200
transactional TCP).

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 248


Chapters 10, 11 and 12. THE APPLICATION LAYER

S.No Questions Page No


Discuss about the DNS. * What is the use of DNS? Explain how it
works? * Discuss the DNS message format for query and reply
114 messages. * How does DNS perform name resolution? Explain with 203
example * If a DNS domain name is XXX.YYY.edu, how many labels
are involved in here? What is the lowest level domain and what is the
highest level domain in this example?
115 What is a name server? List and explain the characteristic features of 204
various name servers.
116 What is resource record? What is its format? 205

What is Electronic mail? Explain the two scenarios of architecture of E-


117 mail. * What are the fields in message header of email system? 207
Briefly discuss about the User Agent.
118 Explain MIME. * Write short notes on MIME. 208

119 What is the role played by message transfer agent? Explain. 209

120 Explain the two scenarios of architecture of E-Mail. 209

121 How POP works? What are the advantages of IMAP over POP? 210
Differentiate IMAP and POP3
122 What is the architecture of WWW? 211

123 What is an URL and what are its components? 211

When user clicks a hyperlink, what are the steps that occur between the
124 212
user’s click and the page being displayed? * Discuss client and server
side functionality of this WWW architecture.
125 Explain a Cookie, its types and uses. 213

126 Differentiate between static and dynamic content in WWW. How are 215
they provided?
127 Explain the http request methods? 216

128 Write short notes on Wireless Application Protocol 218

129 Explain Audio compression 222


What is MPEG? How audio & Video are encoded using MPEG?
130 Write short notes on the following: (a) MIME (207) (b) Audio 225
compression (220) (c) DNS (203) (d) Voice over IP (223)
131 How video is played on Demand 230

132 Explain the basic principles of cryptography. 233

133 Explain substitution and transposition cipher. 234

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 249


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 250


SYLLABUS

COMPUTER NETWORKS CC: GR15A2077

Unit-I

Introduction: Uses of Computer Networks, Network Hardware, Network Software, Reference


Models: OSI, TCP/IP, Examples Networks: Arpanet, Internet, ATM.

Physical Layer: Guided Transmission media, Wireless Transmission Media, Communication


Satellites. The public Switched Telephone Network, the Mobile Telephone Network

Unit-II

Data link layer: Design issues, framing, error detection and correction, Elementary Data Link
Protocol, Sliding Window Protocols.

Medium Access sub layer: The Channel Allocation Problem, Multiple Access Protocols,
Ethernet, wireless LANS, Bluetooth, Data Link Layer Switching.

Unit-III.

Network Layer: Network Layer Design Issues, Routing Algorithms, Congestion Control
Algorithms, QoS, & the Network Layer in the Internet.

Unit-IV.

Transport Layer: Transport Services, Elements of Transport Protocols. The Internet Transport
Protocols: UDP & TCP.

Unit-V.

Application Layer: DNS, Electronic Mail, the World Wide Web, Multi Media, Cryptography.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 251


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 252


MODEL QUESTION PAPERS

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 253


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 254


CODE: GR14A2077 Model Paper - 01 SET - 1

GR11D5104III B.Tech I Semester Regular Examinations, November, 2017.


Computer Networks
GR11D5104 (Dept. of CSE)
Time: 3 hours Max Marks: 70
GR11D5104 PART – A
Answer ALL questions. All questions carry equal marks.
GR11D5104 **** 2 * 10 = 20 Marks
1). a Explain PEER to PEER Networking [2]
Compare and contrast flow control and error control.
GR11D5104
b [2]
c Describe the static channel allocation in LANs and MANs. [2]
d What is Optimality Principle? [2]
e Explain classless inter domain routing [2]
f Discuss the drawbacks of flooding. [2]
g Briefly discuss about the User Agent. [2]
h How admission control is used for controlling congestion in virtual circuits. [2]
i Write the advantages of optical fiber over twisted-pair and coaxial cables. [2]
Types of DNS servers. [2]
j

PART – B.
Answer any FIVE questions. All questions carry equal marks

*****
10 * 5 = 50 Marks
2. a).Differentiate among LAN, MAN and WAN in terms of topology and [10]
technology used by each network.
b). Compare and contrast the OSI and TCP/IP reference models.
3. a). Write short notes on Arpanet. [10]
b). Give a detailed description of the Novell Netware reference model.
4. a). Explain the design issues of data link layer. [10]
b). Explain the following CSMA schemes: (i) Non-persistent, (ii) 1-persistent
(iii) p-persistent.
5. a).What are the different types of networking / internetworking devices ? [10]
b). Explain any two elementary data link protocols.
6. a). What is non- adaptive routing. Explain any two non- adaptive routing [10]
algorithms.
b). Differentiate between open loop and closed loop congestion control.
7. a). Explain Berkeley socket primitives for TCP. [10]
b) How crash recovery managed at the transport layer? Explain.
8. a). What is Electronic mail? Explain the two scenarios of architecture of E-mail. [10]
b). Explain the http request methods?

*****

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 255


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 256


CODE: GR14A2077 Model Paper - 02 SET - 2

III B.Tech I Semester Regular Examinations, November, 2017


GR11D5104 Computer Networks
(Dept. of CSE)
Time: 3 hours
GR11D5104 Max Marks: 70
PART – A
GR11D5104 Answer ALL questions. All questions carry equal marks.
*****.
GR11D5104 2 * 10 = 20 Marks.
1). a Write the technical differences between FDM and TDM. [2]
b GR11D5104
A bit string, 0111101111101111110, needs to be transmitted at the data link [2]
layer. What is the string actually transmitted after bit stuffing?
c Differentiate between unicast and multicast. [2]
d What is the role of choke packet in managing congestion? [2]
e Drawbacks of classfull addressing [2]
f What is an URL and what are its components? [2]
g Why tunneling is used for routing in mobile hosts? [2]
h Explain frequency reuse principle. [2]
i Explain about Downward multiplexing [2]
j Explain about service classes in QoS in internet. [2]

PART – B
Answer any FIVE questions. All questions carry equal marks
**** 10 * 5 = 50 Marks
2. a). What are the reasons for using layered protocols. [10]
b). Illustrate simplex, half-duplex and full duplex modes. What mode is used
when two people are communication by a telephone line?
3. a). Explain about DAMPS. [10]
b). Draw the ATM protocol model and describe the functions performed by each
layer.
4. a).Explain one bit sliding window protocol. Give the advantages and [10]
disadvantages of one-bit sliding window protocol?
b). Explain the protocol stack in Bluetooth.
5. a). Discuss with the help of a figure the frame structure of IEEE 802.3. [10]
b). Explain the Open Shortest Path First (OSPF) routing protocol.
6. a). What is meant by congestion in network? Discuss the various reasons for [10]
congestion.
b). What is NAT? How can NAT help in address depletion?
7. a). Explain the TCP connection management. [10]
b). Define UDP and discuss the different fields of the format of a used
datagram? Also, list some of the uses of the UDP protocol?
8. a). Explain the basic principles of cryptography. [10]
b). What is the architecture of WWW? Discuss client and server side
functionality of this architecture.

*****

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 257


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 258


CODE: GR14A2077 Model Paper - 03 SET - 3

III B.Tech I Semester Regular Examinations, November, 2017


GR11D5104 Computer Networks
(Dept. of CSE)
Time:
GR11D5104
3 hours Max Marks: 70
PART – A
GR11D5104 Answer ALL questions. All questions carry equal marks
**** 2 * 10 = 20 Marks
GR11D5104
1). a Describe Wide Area Networks. [2]
b What are the different categories of a twisted pair cables. [2]
GR11D5104
c Define piggybacking and write its uses. [2]
d Sketch the Manchester encoding for the bit stream: 0001110101. [2]
e Explain Load shedding for congestion control. [2]
f Give the advantages of hierarchical routing. [2]
g Difference between Distance vector routing and link state routing [2]
h Explain about fast Ethernet [2]
i Write any two differences between IPV4 and IPV6 [2]
j What are the functions of ICMP. [2]

PART – B
Answer any FIVE questions. All questions carry equal marks
*****
10 * 5 = 50 Marks

2. a). Explain with the help of a diagram the Layered Architecture of OSI [10]
Reference Model.
b). Discuss about guided and unguided transmission media.
3. a). Explain the principle difference between CO communication and CL [10]
communication.
b). Explain the differences between switching methods.
4. a). Discuss about the file key assumptions in case of dynamic channel allocation [10]
in LANs and WANs?
b).Draw a basic block diagram of ARQ and explain Selective Repeat ARQ
Method.
5. a). Explain the functions of repeaters and bridges. What are their limitations? b). [10]
Explain the BGP protocol for exterior gateway routing in Internet.
6. a). What is traffic shaping? Briefly explain the two techniques of traffic shaping. [10]
b). Explain about Dijkstra’s shortest path routing algorithm with example.
7. a). Explain link state routing in detail. [10]
b).Explain about the TCP segment header with a neat diagram.
8. 8. Write short notes on the following: [10]
(a) MIME (b) Audio compression (c) DNS (d) Voice over IP.

*****

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 259


This page is intentionally left blank.

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 260


CODE: GR14A2077 Model Paper - 04 SET - 4

III B.Tech I Semester Regular Examinations, November, 2017


GR11D5104 Computer Networks
(Dept. of CSE)
Time: 3 hours
GR11D5104 Max Marks: 70
PART – A
GR11D5104Answer ALL questions. All questions carry equal marks
***** 2 * 10 = 20 Marks
GR11D5104
1). a What is the significance of twisting in twisted pair cable? [2]
b GR11D5104
Explain the features and advantages of VLAN. [2]
c Explain the operation of slotted ALOHA. [2]
d Differentiate between flooding and broad cast. [2]
e What is Jitter? How Jitter is controlled? [2]
f Explain upward multiplexing. [2]
g Types of DNS servers? [2]
h Briefly explain about DHCP [2]
i Explain about warning bit in datagram subnets. [2]
j Differentiate between static and dynamic content in WWW. [2]

PART – B

Answer any FIVE questions. All questions carry equal marks

10 * 5 = 50 Marks

2. Write short notes on the following: [10]


(a) Client server model (b) MAN
(c) Interfaces and services (d) Protocols
3. a). Explain the working of the Time Division Multiplexing. [10]
b). With neat diagram, explain ATM cell header format.
4. a). Explain Bit-Map and Binary Countdown collision-free protocols. [10]
b). Compare and contrast Transparent and Source routing bridges.
5. a). Explain about the Sliding Window Protocols. [10]
b). What are the different types of error detection methods? Explain the CRC
error detection technique using generator polynomial x4+x3+1 and data
11100011.
6. a).Explain about Distance Vector Routing Algorithm with example. [10]
b).Explain the Count- to- infinity problem and solution in distance vector
routing.
7. a). Compare and contrast datagram Vs Virtual circuit subnets. [10]
b). Explain Initial connection protocol.
8. a).Write short notes on Wireless Application Protocol. [10]
b). When user clicks a hyperlink, what are the steps that occur between the
user’s click and the page being displayed?

*****

Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 261


Dr.G.S.Bapi Raju, Professor, Dept. of CSE, GRIET, Hyderabad. Page 262

You might also like