Computer Networks Introduction to Computer Networks
Linux System Structure Corbet et al, Linux Device Drivers, O Reilly, 2005
Categories of System Calls Process Control load, execute, end, abort, create process (fork), terminate process, File management create file, delete file, open, close, read, write,... Device Management request device, release device, read, write, Information Maintenance get/set time or date, get/set system data, Communication create, delete communication connection, send, receive messages, transfer status information,
Network Fundamentals
Types of transmission techniques Broadcast Links Multicasting WLAN Bus-/Ring-System Point to Point Links Unicasting Link between Pairs of Computers
Connection oriented vs. connectionless oriented Connection oriented Telephone Byte stream Connectionless oriented Postal system Datagram
Unacknowledged vs. Acknowledged Connection Unacknowledged connectionless service. No attempt to recover lost frame Acknowledged connectionless service. Sender receives an acknowledgement for each and every successfully received frame Acknowledged connection-oriented service. A connection is established prior to sending frames Sender receives an acknowledgement for each and every successfully received frame Sequenced delivery of frames
Example Service Primitives: -Listen -Connect -Receive -Send -Disconnect Connection oriented Service
ISO-/OSI Model
ISO/OSI Model ISO = International Standard Organisation, OSI = Open System Interconnection OSI developed by ISO in 1984 ISO/OSI Model is a layered model: networking framework to implement protocols provides a standard different vendors (NSP, ISP) can interoperate allows multiple manufacturers the development of network component allows communication of various types of network hardware and software defines how data and network information flow through the network defines input and output for each layer changes in one layer are not affecting other layers
Data Transmission in OSI Application Layer Application protocol Data Presentation Layer Presentation protocol AH Data Session Layer Session protocol PH Data Transport Layer Transport protocol SH Data Network Layer Network protocol TH Data Data Link Layer NH Data Physical Layer DH Bits DT
Layer 7: Application Supports Applications and End-user Processes Management of Network Functions Application Presentation Session e.g.: Application: FTP, Telnet, Web browser Transport Network Protocols: HTTP, SMTP, SNMP, FTP, Telnet, SSH, NFS, RTSP, POP Data Link Physical
Layer 6: Presentation Coding, Syntax Data Interpretation and Representation Data Encryption, Compression, Translation services Application Presentation Session e.g.: Formats: ASCII, EBCDIC, MIDI, MPEG, RTF, Quicktime Transport Network Data Link Protocols: XDR, ASN.1, SMB, AFP Physical
Layer 5: Session Connection Management between end-systems Session and Connection Coordination Application Presentation e.g.: Protocols: RPC, NetBIOS, ASP, RTP Session Transport Network Data Link Physical
Layer 4: Transport Reliable or Unreliable delivery Handle end-to-end Error recovery, correction System Endpoint Addressing (Ports) Application Presentation Session e.g.: Network Device: Firewalls Transport Network Protocols: TCP, UDP, SCTP, SPX, ATP Data Link Physical
Layer 3: Network Logical Addressing for path determination through the network Relaying of Data streams Data Transmission from node to node (Hop-to-Hop) Switching, routing, forwarding, addressing, error management, congestion control & packet sequencing e.g.: Network Device: Routers Protocols: IP, ICMP, IGMP, IPsec, ARP, RARP, OSPF, RIP, IPX Application Presentation Session Transport Network Data Link Physical
Layer 2: Data Link Layer Service interface to the network layer Encodes frames into bits for the physical layer (framing) Flow control and frame synchronization Transmission errors Physical Addressing Application Presentation Session Transport Network e.g.: Network Devices: Bridge, switch, hub, Network Interface Card (NIC) Protocols: Ethernet, Token Ring, PPP, Frame Relay, ISDN, ATM Data Link Physical
Layer 1: Physical Layer Electrical signals: i.e. conveys bit stream into electrical impulse Wiring standards at electrical and mechanical level Channel Coding, Modulation Application Presentation Session Transport e.g.: Network Device: cables, media converters, repeaters, connectors Network Data Link Physical
Data Transmission in OSI Application Layer Application protocol Data Application Layer Presentation Layer Presentation protocol AH Data Presentation Layer Session Layer Session protocol PH Data Session Layer Transport Layer Transport protocol SH Data Transport Layer Network Layer Network protocol TH Data Network Layer Data Link Layer NH Data Data Link Layer Physical Layer DH Bits DT Physical Layer
TCP/IP Model OSI TCP/IP 7 Application Layer Application Layer 6 5 4 3 2 1 Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer Transport Layer Internet Layer Network Layer
The End-to-End Principle Ford, A., Raiciu, C., Handley, M. & Bonaventure, O., 2013. RFC 6824: TCP Extensions for Multipath Operation with Multiple Addresses, Internet Engineering Task Force.
Leon-Garcia, A. & Widjaja, I., 2004. Communiation Networks Fundamental Concepts and Key Architectures, 2. Ausg., McGraw-Hill.
Transport Control Protocol - TCP
Webserver Listening Client Server
Client sends Request SYN Client Server
Server sends Acknowledgment SYN/ACK Client Server
Client sends Acknowledgment ACK Client Server
Connection established Client Server
Server reads Request Data 01 Client Server
Server reads Request Data 02 Data 01 Client Server
Server reads Request Data 03 Data 02 Data 01 Client Server
Server send Acknowledgments Data 03 Data 02 Client ACK 01 Server
Server send Acknowledgments Data 03 Client ACK 01 ACK 02 Server
Server send Acknowledgments Client ACK 01 ACK 02 ACK 03 Server
Lost Packet Data 03 Data 02 Data 01 Client Server
Server send Acknowledgments Client ACK 01 ACK 03 Server
TCP State Machine: Open and Closing
Questions Connection Oriented? Reliable? Which ARQ protocol? (Stop-and-Wait, Go-back-n, Selective- Repeat)
Connection in TCP Most important Transport Layer Protocol on the Internet (developed 1974 by Cerf&Kahn) Reliable and Connection oriented Connection between two endpoints Connection endpoint 5-Tupel <local IP address, local port number, protocol no, remote IP address, remote port number> Byte stream bidirectional data communication
Sending a file Application Layer File Socket Transport Layer Divide in Segements Send to next Layer Network Layer
Reliability of TCP In-order delivery via sequence numbers Automatic Repeat Request (ARQ) via Acknowledgements of each received packet (ACK) Checksums for reliable data delivery (Sum of 16-bit words in Ones-complement) Flow Control to not flood receiver Congestion Control to not flood the network
TCP Sequencing Data 03 Data 02 Data 01 Synchronization of Data between Sender & Receiver Payload (Byte) increasingly numbered (use first Databyte) e.g.: DS0: 0, DS1: 1059, DS2: 2118,... 32-Bit-Sequence Number Receiver is able to : reassemble Data in right order identify gaps or duplicates
Three Way Handshake :Host A :Host B
Sequencing :Host A SEQ=0 :Host B SEQ=1059 SEQ=2118
Timer Duplicate ACK & Resending :Host A SEQ=0 :Host B SEQ=1059 SEQ=2118 SEQ=1059
Timeout Sending of a Datasegment Start Timer Timeout of Timer: Datasegment loss Resending of Datasegment Timeout Calculation: Timeout = SRTT + 4 RTTVAR where SRTT = α SRTT + (1 - α) RTT RTTVAR = β RTTVAR + (1 β) SRTT - RTT α = 7/8, β = 3/4
Server send Acknowledgments Client ACK 01 ACK 03 Server Timer runs at Client site if no ACK resending data Client must buffer packets until ACKed If packet is lost (or coming late) Server must buffer all incoming packets until problem is solved
Sliding Window Flow Control Sender only sends as much data the receiver can take Packet size depends on receiver s buffer/window (MSS Maximum Segment Size) MSS calculated with Maximum Transmission Unit (MTU) Value between 64.. 1460 Byte Calculation of Receiver Window: where Receiv_wnd = 2 BDP BDP = Bandwidth One-Way-Delay Current Window Size sent by each ACK-Segment
TCP Frame Structure
Congestion Control Data Transmission if possible: Maximum Utilization Prevention of Network Congestion by Limiting data flow in the network Adjusting the sending buffer/window Option: Measuring of Segment losses The more segments error free, the less congestion Size of Congestion Window correspond to number of possible Bytes the Network can admit
Congestion Control Four Algorithms: 1. Slow Start 2. Congestion Avoidance (Additive Increase) 3. Fast Retransmit 4. Fast Recovery Slow Start-Algorithm: Datasegments sent slowly Finding out available capacity of network Not to flood network Slow Start Threshold = MAX (Flight Size/2, 2 MSS) where Flight Size = Size of all unacknowledged Segments on the Network
Congestion Control Congestion Window Threshold Congestion Avoidance Algorithmus Congestion Avoidance Algorithm: Congestion Window increased linearly with one Segment size per RTT if Packet loss: Slow Start starts again
Congestion Control Algorithms Fast Retransmit & Fast Recovery: decrease Error Detection time Duplicate ACK ACK with same Sequence Number If 3 Dup-ACKs then: Slow Start Threshold = Congestion Window / 2 Congestion Window = Slow Start Threshold + 3 MSS Congestion Avoidance Algorithmus continues...
Tanenbaum, A.S. & Wetherall, D.J., 2012. Computernetzwerke, 5. Ausg., München, BRD, Pearson Deutschland GmbH.
References Sameer Seth, M. Ajaykumar Venkatesulu, TCP/IP Architecture, Design and Implementation in Linux, IEEE Computer Society, 2008 Andrew S. Tanenbaum, Computernetworks, 5th Edition, Pearson, 2012 Cerf, V., & Kahn, R. (5 1974). A Protocol for Packet Network Intercommunication. IEEE Transactions on Communications, 22(5), S. 637-648. Postel, J. (09/1981). RFC 793, Transmission Control Protocol. Internet Engineering Task Force. Jacobson, V. (1988). Congestion Avoidance and Control. SIGCOMM '88 Symposium proceedings on Communications architectures and protocols Aug 16-18, 18(4), S. 314 329. Fall, K., & Stevens, W. (2012). TCP/IP Illustrated, Volume 1, The Protocols (2 Ausg.). Michigan, USA: Pearson Education Inc. Wireshark, Protocol Analyzer, [Online], 2017, https://www.wireshark.org/.