Computer Networking: Principles, Protocols and Practice © Olivier Bonaventure
Total Page:16
File Type:pdf, Size:1020Kb
Computer Networking: Principles, Protocols and Practice © Olivier Bonaventure Printing History May 2015: Adopted in Open Textbooks System (http://www.opentextbooks.org.hk) This work is licensed under a Creative Commons-ShareAlike 4.0 International License Original source: Multimedia Educational Resource for Learning and Online Teaching http://www.merlot.org/merlot/viewMaterial.htm?id=656489 Contents Chapter 1 Preface ..........................................................................................................1 Chapter 2 Introduction ..................................................................................................3 2.1 Services and protocols.....................................................................................................10 2.2 The reference models .....................................................................................................21 2.2.1 The five layers reference model ..........................................................................22 2.2.2 The TCP/IP reference model ...............................................................................26 2.2.3 The OSI reference model......................................................................................26 2.3 Organisation of the book ................................................................................................28 Chapter 3 The application Layer ................................................................................30 3.1 Principles ...........................................................................................................................30 3.1.1 The peer-to-peer model ......................................................................................34 3.1.2 The transport services ..........................................................................................34 3.2 Application-level protocols .............................................................................................36 3.2.1 The Domain Name System...................................................................................36 3.2.2 Electronic mail .......................................................................................................44 3.2.3 The HyperText Transfer Protocol ........................................................................60 3.3 Writing simple networked applications ........................................................................73 3.4 Summary ..........................................................................................................................81 3.5 Exercises ...........................................................................................................................81 3.5.1 The Domain Name System ..................................................................................81 3.5.2 Internet email protocols ......................................................................................83 3.5.3 The HyperText Transfer Protocol .......................................................................86 Chapter 4 The transport layer.....................................................................................88 4.1 Principles of a reliable transport protocol ....................................................................89 4.1.1 Reliable data transfer on top of a perfect network service..............................89 4.1.2 Reliable data transfer on top of an imperfect network service.......................92 4.2 The User Datagram Protocol........................................................................................ 114 4.3 The Transmission Control Protocol............................................................................. 116 4.3.1 TCP connection establishment ......................................................................... 119 Denial of Service attacks .................................................................................... 123 Retransmitting the first SYN segment .............................................................. 124 4.3.2 TCP connection release ..................................................................................... 125 4.3.3 TCP reliable data transfer.................................................................................. 128 4.4 Summary ....................................................................................................................... 152 4.5 Exercises ........................................................................................................................ 152 4.5.1 Principles ............................................................................................................. 152 4.6 Practice ........................................................................................................................... 158 Chapter 5 The network layer ....................................................................................170 5.1 Principles ........................................................................................................................ 170 5.1.1 Organisation of the network layer ................................................................... 173 5.1.2 The control plane ............................................................................................... 177 5.2 Internet Protocol............................................................................................................ 189 5.2.1 IP version 4.......................................................................................................... 190 5.2.2 ICMP version 4 .................................................................................................... 203 5.2.3 IP version 6.......................................................................................................... 213 5.2.4 ICMP version 6 .................................................................................................... 223 5.2.5 Middleboxes........................................................................................................ 227 5.3 Routing in IP networks .................................................................................................. 232 5.3.1 Intradomain routing........................................................................................... 233 5.3.2 Interdomain routing........................................................................................... 240 5.4 Summary ....................................................................................................................... 266 5.5 Exercises ........................................................................................................................ 266 5.5.1 Principles ............................................................................................................. 266 5.5.2 Practice ................................................................................................................ 276 Chapter 6 The datalink layer and the Local Area Networks ................................287 6.1 Principles ........................................................................................................................ 287 6.1.1 Framing................................................................................................................ 288 6.1.2 Error detection ................................................................................................... 291 6.2 Medium Access Control ................................................................................................ 293 6.2.1 Static allocation methods.................................................................................. 294 6.2.2 ALOHA.................................................................................................................. 296 6.2.3 Carrier Sense Multiple Access .......................................................................... 298 6.2.4 Carrier Sense Multiple Access with Collision Detection ................................ 300 6.2.5 Carrier Sense Multiple Access with Collision Avoidance ............................... 306 6.2.6 Deterministic Medium Access Control algorithms......................................... 310 6.3 Datalink layer technologies ......................................................................................... 314 6.3.1 The Point-to-Point Protocol............................................................................... 314 6.3.2 Ethernet............................................................................................................... 316 6.3.3 802.11 wireless networks .................................................................................. 333 6.4 Summary ....................................................................................................................... 340 6.5 Exercises ......................................................................................................................... 341 Chapter 7 Glossary .....................................................................................................343 Chapter 8 Bibliography ..............................................................................................350 1 Chapter 1 Preface Available under Creative Commons-ShareAlike 4.0 International License (http://creativecommon s.org/licenses/by-sa/4.0/). This textbook came from a frustration of its main author. Many authors chose to write a textbook because there are