Data Communication and Computer Networks

Similar documents
Data Communication and Computer Networks

Data Communication Principles

COMS Introduction to Computers. Networking

Introduction to computer networking

Layering in Networked computing. OSI Model TCP/IP Model Protocols at each layer

Data & Computer Communication

Networking and Internetworking 1

The OSI Model. Open Systems Interconnection (OSI). Developed by the International Organization for Standardization (ISO).

Lecture 2: Internet Structure

CS3600 SYSTEMS AND NETWORKS

ECE 650 Systems Programming & Engineering. Spring 2018

Introduction to Information Science and Technology 2017 Networking II. Sören Schwertfeger 师泽仁

Network Architecture. TOC Architecture

CS 416: Operating Systems Design April 11, 2011

Defining Networks with the OSI Model. Module 2

Part 1: Introduction. Goal: Review of how the Internet works Overview

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Networking Applications

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Communication Networks

Introduction to Information Science and Technology 2017 Networking I. Sören Schwertfeger 师泽仁

Networking Background

Network Architecture

DATA COMMUNICATION AND NETWORKS

Announcements Computer Networking. What is the Objective of the Internet? Today s Lecture

Chapter 15 Networks. Chapter Goals. Networking. Chapter Goals. Networking. Networking. Computer network. Node (host) Any device on a network

Communication Networks

Network Protocols and Architectures

Computer Communication Networks

BLM6196 COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS

ITEC 3210 M - Applied Data Communications and Networks. Professor: Younes Benslimane, Ph.D.

cs144 Midterm Review Fall 2010

CS321: Computer Networks Introduction to Computer Networks and Internet

Network Model. Why a Layered Model? All People Seem To Need Data Processing

Networking and Internetworking 1

CS 204: Advanced Computer Networks

Internet Architecture & Performance. What s the Internet: nuts and bolts view

Principles behind data link layer services

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Raj Jain. The Ohio State University Columbus, OH

networks List various types of networks and their

Need For Protocol Architecture

Need For Protocol Architecture

Peer entities. Protocol Layering. Protocols. Example

CS4700/CS5700 Fundaments of Computer Networks

Principles behind data link layer services:

Principles behind data link layer services:

Layering and Addressing CS551. Bill Cheng. Layer Encapsulation. OSI Model: 7 Protocol Layers.

Lecture 17 Overview. Last Lecture. Wide Area Networking (2) This Lecture. Internet Protocol (1) Source: chapters 2.2, 2.3,18.4, 19.1, 9.

ITP 140 Mobile Applications Technologies. Networks

Internet Routing. Review of Networking Principles. What s the Internet: nuts and bolts view. Communication links

Internet Routing. Review of Networking Principles

Network Models. Behrouz A. Forouzan Data communication and Networking Fourth edition

CS61C : Machine Structures

Chapter 7. Local Area Network Communications Protocols

Overview of Network Software. CS158a Chris Pollett Jan 31, 2007.

ECE 158A: Data Networks I. Fall 2015 Massimo Franceschetti

CSC 4900 Computer Networks: Introduction

Chapter -4 OSI Reference Model

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Chapter 2 Communicating Over the Network

Revision of Previous Lectures

infrared Disadvantage: 1. cannot use for long-range communication or outside a building due to sun s rays.

CSE3213 Computer Network I

Chapter 2 Network Models 2.1

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

CSCI Computer Networks

ITP 140 Mobile Applications Technologies. Networks

CPEG514 Advanced Computer Networks. Atef Abu Salim University of Nizwa Spring 2013/2014

The Internet and the World Wide Web

Network Models. Presentation by Dr.S.Radha HOD / ECE SSN College of Engineering

Announcements. CS 5565 Network Architecture and Protocols. Outline for today. The Internet: nuts and bolts view. The Internet: nuts and bolts view

Chapter 12 Network Protocols

Chapter 1. Computer Networks and the Internet

CPS221 Lecture: Layered Network Architecture

TCOM 370 NOTES 99-1 NETWORKING AND COMMUNICATIONS

CS61C : Machine Structures

Chapter 2 Network Models 2.1

ECE4110 Internetwork Programming. Introduction and Overview

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Networking. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Lecture 3 Protocol Stacks and Layering

Computer Networks and the internet. Daniel Graham Ph.D

Network.... communication system for connecting end- systems. End-systems a.k.a. hosts PCs, workstations dedicated computers network components

precise rules that govern communication between two parties TCP/IP: the basic Internet protocols IP: Internet protocol (bottom level)

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Distributed Systems. 02. Networking. Paul Krzyzanowski. Rutgers University. Fall 2017

Lecture-4. TCP/IP-Overview:

Networking and TCP/IP. John Kalbach November 8, 2004

CSCD 433/533 Advanced Networks

Special expressions, phrases, abbreviations and terms of Computer Networks

Packet Switching, Layer Models and Protocol Suites

Course on Computer Communication and Networks. Lecture 1 Chapter 1: Introduction Part A: Internet, Protocol Layering and Data

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY

Lecture A4 Network / Internet. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

ECS 15; Lectures 17 and 18. The Internet. What is the internet, and how does it work? TA feedback

Data Link Layer. Our goals: understand principles behind data link layer services: instantiation and implementation of various link layer technologies

b) Diverse forms of physical connection - all sorts of wired connections, wireless connections, fiber optics, etc.

Transcription:

Data Communication and Computer Networks Mahalingam Ramkumar Mississippi State University, MS August 16, 2015 Ramkumar CSE 4153 / 6153

1 Introduction 2 3 TCP/IP Model Sockets Tasks By Layer Additional OSI Layers 2 / 61

Data Communication Networks Data (digital data in the form of bits) Communication (exchange of data) Network (the facilitator) For the purposes of this course: bits (chunks, streams, or packets) exchanged between computers; The network is the Internet 3 / 61

Expectations For advanced Juniors, Seniors and Graduate students No hand-holding; no text book. Broad topics/concepts will be discussed. You are expected to effectively utilize other online resources C or C++ (for socket programming assignments) Self-learn useful tools for implementing simulations in projects Choose your own tool (Python numpy/scipy, Matlab/Octave/Freemat etc.) Self-learn tools like Wireshark, tcpdump, etc., for capturing and analysing network packets 4 / 61

Grading Policies Quizzes/Assignments 30% Exams 35% (15+20) Programming Assignments 10% Projects 15% (can earn bonus points) Participation 10% 5 / 61

Course Outline Overview of the Internet; layered models Data Communication Principles Internet Practices 6 / 61

Data Communication Principles Communication Theory Delays Switching Reliable Data Transmission Error Detection/Correction ARQ Protocols Issues in shared media Topology discovery and controlled flooding 7 / 61

Internet Practices Introduction Protocols in different Internet layers DL/MAC layer protocols IP protocol TCP and UDP Socket Library Applications 8 / 61

Why Digital? More Efficient eg., analog vs digital TV Great equalizer for transmission/reception, storage and processing Does not matter if data is video, audio, image or document, or anything else Better suited for long range transmission Can use repeaters Why is this not suitable for analog transmission? 9 / 61

Terminology Protocol (rigid rules/steps to be followed) Bit-rate (Kbps, Mbps, Gbps) Storage (KB, MB, GB, TB) Useful to be comfortable with powers of 2 2 10 = 1024 1000, 2 20 1, 000, 000 (million), 2 30 1, 000, 000, 000 (billion) IP (Internet Protocol) address, 32-bit unsigned number For convenience represented as 4 1-byte (8-bit) numbers (each in the range 0 to 255) Example, 129.36.42.207. 10 / 61

Some Interesting Quantities 2 8 = 256 possible byte values (0 to 255) 2 10 = 1024 1000 2 16 = 256 256 = 65536; number of port numbers 2 20 1 million. 2 30 1 billion. 2 25 number of seconds in a year. 2 32 4 billion (no. of IPv4 addresses, world population 1975) 2 33 8 billion (world population in 2020?) 2 42 4 trillion (federal budget in 2015) 2 48 256 trillion (number of unique MAC addresses) 2 64 grains of sand in all beaches in the world 2 78 number of water molecules in a Tbsp of water 2 97 number of stars in the observable universe 2 128? 2 266 number of baryons in the observable universe 11 / 61

Introduction Hosts (users of the network) & Network Infrastructure (provider) Postal Network: sender receiver; USPS Telephone network: caller and callee (subscribers); Telephone companies (network) Mobile Telephone: subscribers; service provider. 12 / 61

Internet Components Introduction Network Hosts & Network Infrastructure Host computers: Clients and servers Infrastructure: Internet service providers (ISP) ISPs in different tiers. Tier III ISPs rely on Tier II ISPs, and so on Tier I ISPs are Backbone operators. Some large users (eg., Google, Netflix, Amazon, Yahoo) may connect directly to Tier I ISPs. Infrastructure components: Routers and Links (fiber, twisted pair, coax, wireless, satellite) 13 / 61

Internet Components Introduction Network Hosts & Network Infrastructure Host computers: Clients and servers Infrastructure: Internet service providers (ISP) ISPs in different tiers. Tier III ISPs rely on Tier II ISPs, and so on Tier I ISPs are Backbone operators. Some large users (eg., Google, Netflix, Amazon, Yahoo) may connect directly to Tier I ISPs. Infrastructure components: Routers and Links (fiber, twisted pair, coax, wireless, satellite) 13 / 61

Internet Components Introduction Network Hosts & Network Infrastructure Host computers: Clients and servers Infrastructure: Internet service providers (ISP) ISPs in different tiers. Tier III ISPs rely on Tier II ISPs, and so on Tier I ISPs are Backbone operators. Some large users (eg., Google, Netflix, Amazon, Yahoo) may connect directly to Tier I ISPs. Infrastructure components: Routers and Links (fiber, twisted pair, coax, wireless, satellite) 13 / 61

Classical Telephone Network Telephones connected by a wire (twisted pair copper) to a local switching office (up to 10000 phones) Several local switching offices are connected to an area switching office (up to 1000 LSO per ASO) Area switching offices are interconnected (1000 ASOs) Each wire (from a phone to a switching office) is associated with a unique (phone) number eg. (662) 323-xxxx area code 662 identifies area switching office 323 identifies local switching office; every wire terminating at switching office 323 has a unique four digit number xxxx. 14 / 61

Classical Telephone Network When the telephone receiver is lifted off the base the wire is activated (user hears a dial tone) User dials a destination number this is an instruction to the LSO to establish a path between the two phones 662 323 5678 301 506 7259 662 323 5678 LSO 323 ASO 662 ASO 301 LSO 506 301 506 7259 the path can be used for sending electrical signals between the two phones. 15 / 61

Classical Telephone Network Mouthpiece converts sound vibrations (pressure) to an electrical signal Electrical signals conveyed over the wire (at the speed of light in copper) to the telephone at the other end. At the receiver, earpiece converts electrical signals to pressure vibrations (sound) Replacing the telephone on the hook terminates the connection. Telephone company keeps a record of the destination and duration of your call (for billing purposes). 16 / 61

Classical Telephone Network Mouthpiece converts sound vibrations (pressure) to an electrical signal Electrical signals conveyed over the wire (at the speed of light in copper) to the telephone at the other end. At the receiver, earpiece converts electrical signals to pressure vibrations (sound) Replacing the telephone on the hook terminates the connection. Telephone company keeps a record of the destination and duration of your call (for billing purposes). 16 / 61

Postal Network Introduction Users address mail/packages and drop them into boxes. Picked up by postal carriers Depending on the final destination the mail/package may be routed over several hops Possibly different modes of transportation at each hop (foot, bicycle, van, train, airplane, ) Mail finally delivered to the destination address. Postal network uses packet switching. Telephone network uses circuit switching 17 / 61

Postal Network vs Telephone Network Postal network uses packet switching. Telephone network uses circuit switching. 18 / 61

The Internet at a Glance Hosts (computers), inter-connected routers (subnet); Every host has a unique IP address (32-bit address, about 4 billion unique addresses). Any host can send a packet (an IP packet) to any host. IP packets have a header indicating the IP addresses of the sender and the destination. IP packet also have a payload (any data that the sending host wants to send to the destination host) IP Packets are typically delivered over multiple hops a router at each hop. 19 / 61

Routers and Links Introduction Every host has a direct connection to one router. A router can determine the best path to any other router. Does packet switching. At each link (between any two hops) IP packets are carried inside a data-link frame the type of the data-link frame depends on the physical nature of the link (fiber, twisted pair, coax, wireless, satellite, etc.) 20 / 61

Packet Switching in the Internet Router Subnet Sending host B D Receiving host A E C Sending process Packet Router C makes a choice to forward packets to E and not to D Receiving process 21 / 61

Postal Network vs Internet The Internet is more like the postal network (and less like the telephone network) Both employ packet switching Street Address IP address Postal envelopes IP packets; Post office sorting facilities routers transportation modes (road+truck) link + data-link frames 22 / 61

Postal Network vs Internet Postal envelopes carry a letter from sender to receiver; IP packets carry an application message; different transportation mechanisms over each hop truck over road, train over rails, ships over oceans/waterways etc. different types of data-link frames over different types of physical layers; Ethernet over twisted pair, Wireless Ethernet over air, ALOHA over satellite links, FTTH over fiber, etc. The main difference is the speed IP packets travel at the speed of light The Internet is postal network on steroids! 23 / 61

Virtual Link Between Hosts The speed of exchanges motivates sophisticated Internet based applications Applications running on hosts use the Internet to communicate with applications running on other hosts (possibly even at the other side of the globe) From the perspective of applications, the Internet enables a virtual link between hosts. 24 / 61

Internet Layers Application Layer (AL) Transport Layer (TL) Network Layer (NL) Data-Link Layer (DL) Physical Layer (PL) Each layer has a specific function. Components in one layer can be modified without affecting other layers. All Top Notch Donut Places (useful? mnemonic) 25 / 61

Lower and Upper Layers The two lower layers (PL and DL) are necessary for the functioning of the NL (to create a virtual link between hosts) The two upper layers (TL and AL) are required to use the virtual link 26 / 61

Lower Layers Introduction Physical Layer convert data-link frames to electrical signals for delivery over a physical medium Data-link Layer preparing data-link frames (which carry IP packets) for efficient utilization of the physical layer (physical layer could be unreliable) Network layer determines how IP packets will need to be routed, depending on the destination IP address 27 / 61

Upper Layers Introduction Transport Layer converts the unreliable virtual link between two hosts (thanks to Network layer) into a reliable connection, to carry application messages Application Layer uses the reliable virtual link to send application messages (between an application running on one host and an application running on another host) 28 / 61

Apparent and Actual Data Paths AL AM App. Message AL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL Net. Packet NH TH AM NL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL DL Net. Packet NH TH AM DL Frame NL DL DL Frame = DH NH TH AM DF

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL DL Net. Packet NH TH AM DL Frame NL DL DL Frame = DH NH TH AM DF PL PL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL DL Net. Packet NH TH AM DL Frame NL DL DL Frame = DH NH TH AM DF NL DL PL PL PL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL DL Net. Packet NH TH AM DL Frame NL DL DL Frame = DH NH TH AM DF NL DL NL DL PL PL PL PL

Apparent and Actual Data Paths AL TL AM TH AM App. Message Trans. Segment AL TL NL DL Net. Packet NH TH AM DL Frame NL DL Virtual Link DL Frame = DH NH TH AM DF NL DL NL DL PL PL PL PL 29 / 61

Apparent and Actual Data Paths NL NL DL PL DL PL DL PL 30 / 61

Introduction Several hosts connected to a router in the same local area network (LAN) LANs may be interconnected by routers to form small networks small networks may be interconnected to form larger networks (for example, an organization) organizations connect to an Internet Service Provider (ISP) ISPs may form several tiers lower tier ISPs connect to higher tier ISPs ISPs at the highest tier interconnected by the Internet backbones. 31 / 61

LAN Introduction Computer Cable Computer (a) (b) 32 / 61

Interconnection of LANs Subnet Router Host LAN 33 / 61

Interconnection of Networks R2 R4 R1 R6 R7 R5 R3

Interconnection of Networks R2 R2 R4 R6 R5 R7 R1 R5 R6 R1 R7 R3 R4 R3

Interconnection of Networks R2 R2 R4 R6 R5 R7 R1 R5 R6 R1 R7 R3 R4 R3

Interconnection of Networks R2 ISP R2 R4 R6 R5 R7 R1 R5 R6 R1 R7 R3 R4 R3 34 / 61

Interconnection of ISPs B3 B1 B2 B8 B7 B4 B6 B5 Tier I I1 Ia I2 I9 I3 I4 I8 I5 I7 I6 Tier II i1 i2 i0 i3 i9 i4 i8 i5 i7 Tier III i6 35 / 61

IP Addresses Introduction 32-bit unsigned number, for example, 10101110 01001000 11000010 11001001 which is 2,924,004,041 more conveniently represented as 174.72.194.201 About 4 billion unique addresses Another example, 130.18.205.15 is actually 10000010 00010010 11001101 00001111 = 2, 182, 270, 223 (1) 36 / 61

IP Address Chunks Introduction Typically, consecutive IP addresses assigned to hosts in the same LAN For example, a LAN with less than 128 (but greater than 64) computers can be assigned addresses 130.18.205.0 to 130.18.205.127, which can all be collectively represented as 10000010 00010010 11001101 0xxxxxxx (2) First 32-7=25 bits are the same in all such addresses A short from for representing such collection is 130.18.205.0/25 (starting address, and the number of common bits for all addresses in the chunk). IP Prefix notation (to represent a chunk of 2 r consecutive addresses, where r is an integer). 37 / 61

Aggregating IP Prefixes Assume an adjacent LAN has addresses in the range 130.18.205.128 to 130.18.205.255 Or prefix 130.18.205.128/25 10000010 00010010 11001101 1xxxxxxx (3) Both chunks can be consolidated as 130.18.205.0/24, or 10000010 00010010 11001101 xxxxxxxx (4) 38 / 61

IP Aggregation Introduction 130.18.205.0/25 130.18.205.128/25 R1 R2 R3 130.18.205.0/24 R5 130.18.204.0/23 R4 130.18.204.0/24 130.18.204.0/24 39 / 61

IP Aggregation Introduction 130.18.205.0/25 130.18.205.128/25 R1 R2 R3 130.18.205.0/24 R5 130.18.204.0/23 R4 130.18.204.0/24 130.18.204.0/24 39 / 61

IP Aggregation Introduction 130.18.205.0/25 130.18.205.128/25 R1 R2 R3 130.18.205.0/24 R5 130.18.204.0/23 R4 130.18.204.0/24 130.18.204.0/24 39 / 61

IP Aggregation Introduction 130.18.205.0/25 130.18.205.128/25 R1 R2 R3 130.18.205.0/24 R5 130.18.204.0/23 R4 130.18.204.0/24 130.18.204.0/24 39 / 61

Introduction The Internet is an interconnection of autonomous systems (AS) ASes advertise IP prefixes to other ASes Every independent organization need not be an AS An AS may include any number of networks / organizations. What is the difference between an organizational network and an AS? 40 / 61

Interconnection of Example Topology O4 A7 O5 A2 O6 O1 O2 A1 O3 A5 A4 A3 A6 Organization vs AS O1 O3 are organizations under AS A1; A 1 advertises prefixes belonging to O1 O3. Typically, ASes like A1 and A2 are ISPs; A3, A4, A5 are also organizations that use ISPs like A1, A2. But they have to be ASes because they have to specify some special policies to others, to reach computers in their organization. A4 and A5 have a peering arrangement Organization A3 uses two ISPs. 41 / 61

Structure of the Internet Regional ISP Backbone POP Client Telephone system NAP Server farm Corporate LAN Router 42 / 61

Network Layer Models TCP/IP Model Sockets Tasks By Layer Additional OSI Layers TCP/IP Model (5 layers) OSI (Open Systems Interconnection) Model (7 layers) Application Presentation Layer Session Layer Transport (TCP / UDP) Network (IP) Datalink / MAC (Medium Access Control) Physical layer Presentation and Session Layers missing in TCP/IP Model All People Seem To Need Data Processing (7-layer mnemonic) 43 / 61

Physical Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Hardware for physically carrying data Over wires, or wireless links modems, Ethernet/Wifi card, etc. 44 / 61

Data Link Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers send a packet of bits from one computer to another when a direct connection exists between the computers Depends on the nature of the physical medium used Two broad categories depending on if the physical medium is shared. For shared media DL protocols includes protocols for Medium Access Control (MAC). Every computer that shares the physical medium should have a unique MAC layer address Contention for channel access needs to be addressed 45 / 61

Network Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Provide a virtual link between two computers. To send a packet from one computer to another A unique network address for every computer Routers relay packets over multiple hops Internet protocol (IP) every computer has a unique IP address 46 / 61

Application and Transport Layer TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Protocols for applications/processes running on different computers to communicate with each other Rely on the virtual link facilitated by the lower layers. 47 / 61

Application Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Client-server model (Client establishes a connection with the server) Client sends a request Server responds (Close connection) Some applications: E-mail, WWW, IM, FTP, File sharing, 48 / 61

Transport Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Provides a reliable connection between processes running on different computers Takes care of many low-level details for creating, maintaining and closing connections Different processes running on a computer differentiated by unique process addresses (port numbers) 49 / 61

TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Application Developer View of Internet Every computer connected to the Internet has a unique IP address Corresponding to each IP address, there may be many application processes willing to accept connection requests at a specific port number. Servers listen wait for connection requests Clients initiate connection requests. Once a connection is established, both client and server can send and receive (any number of) bytes. Connections can then be closed. 50 / 61

Client Server Applications TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Server 0 Listen at some port number 2 Accept connection request 4 Process Query 5 Send Response 7/8 Close Connection Client 1 Request Connection 3 Send Query 6 Receive response 7/8 Close connection 51 / 61

Addressing servers and Clients TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Client needs to know IP address and port number of the server. Usually clients know only the domain name (for e.g., yahoo.com) DNS (domain name system/service) an application that translates domain names to IP addresses (like 411 Directory service); Port number depends on the type of application (standard port numbers) Connection request made by specifying IP address and port number of the server, Also conveys IP address and port number used by the client. 52 / 61

Sockets and Socket Programming TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Software library for network application development; Sockets are similar to file handles File handles bound to a file name (and path); Sockets bound to socket address; Socket address has two components an IP address and a port number Two types of sockets - TCP (transport control protocol) and UDP (user datagram protocol) TCP sockets can be connected. The socket library provides various system calls like socket(), bind(), listen(), connect(), accept(), send(), recv(), close() 53 / 61

Socket (System) Calls Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers sd = socket(options). Creates a socket. sd is a handle to the socket. bind(sd,fromaddress) (local socket address). listen() connect(sd,toaddress) (remote socket address). sd = accept(sd) (accept() returns a connected socket) send(sd,buffer, num bytes). recv(sd,buffer, num bytes). close(sd). These functions are the interfaces provided by the transport layer (to the application layer above). 54 / 61

Transport Layer Tasks Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Establish connections; reliable delivery of application data; differentiating between different communication instances using port numbers; Break up application data into message chunks; add a TRANSPORT header to each message (Transport packet = TRANSPORT header + application message) Send / receive transport packets to / from the network layer. Flow control: what happens if the sender has a high bandwidth connection and the receiver has a low bandwidth connection? Congestion control (helps NL in this process) 55 / 61

AL and TL Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers (Client) AL; port 1546 App. Data (Server) AL; port 80 Transport Layer Trans. Packet = Trans Hdr + App Data Transport Layer NL; IP 120.5.246.47 NL; IP 201.234.56.78 Net. Packet = Net Hdr + Trans Packet Trans. Hdr (1546,80, flags, sequence/ack no.... ) Net. Hdr (120.5.246.47,201.234.56.78,... ) 56 / 61

Network Layer Tasks Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Create IP packets (transport payload + IP header) Routing Determine best next hop to send an IP packet; the final destination for the received packet can be itself accept and provide contents (transport packet) to higher layer; a host that is directly reachable (one hop away) find data-link address of next hop in order to send the IP packet (enclosed in an appropriately addressed data-link frame). a host that is not directly reachable (may be multiple hops away) find data-link address of the next-hop router. Congestion control Fragment/reassemble IP fragments 57 / 61

DL and PL Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers DL / MAC layer Enclose IP packet (to be sent to next hop) in a DL / MAC frame IP packet may be split into multiple smaller chunks (if the DL cannot handle large payloads) MAC Frame = MAC Header + Payload (IP packet) + footer + framing flags at either end. MAC header includes MAC addresses of sender and receiver (one hop away from sender) MAC/DL footer for cyclic redundancy checks (CRC) for error detection. Provide the MAC frame to hardware (Ethernet card, modem) using interfaces to the hardware (drivers) Physical Layer: Convert bits to electrical/electromagnetic signals and send them over the link 58 / 61

Layer Hierarchy Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers AL Destination IP Data Packet Destination Port Origin IP Origin Port TL TH Data TH TH TH NL Next Stop DL Address NH TH Data Origin DL Address DL PL DH NH TH Data Conversion to Electrical Signals TH TCP HEADER, NH IP HEADER, DH MAC HEADER 59 / 61

Presentation Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Syntax and semantics of information transmitted The same sequence of bytes can have different interpretations in different machines/cpus Big-endian vs little-endian All machines need to agree on some byte order (for representing 32-bit IP address and 16-bit port numbers) Network order, host order For TCP/IP translations are provided by some helper functions - htons(), htonl(), ntohs(), ntohl() included in the socket library. 60 / 61

Session Layer Introduction TCP/IP Model Sockets Tasks By Layer Additional OSI Layers Establishing sessions Dialog control (who goes next?) Synchronization (continue seamlessly from previous connection) In TCP/IP model, dialog control and synchronization is the responsibility of the application layer Examples? 61 / 61