CSCI-GA Operating Systems. Networking. Hubertus Franke

Similar documents
Introduction to TCP/IP networking

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

TSIN02 - Internetworking

TSIN02 - Internetworking

User Datagram Protocol

TSIN02 - Internetworking

TSIN02 - Internetworking

ECE4110 Internetwork Programming. Introduction and Overview

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

OSI Transport Layer. objectives

EE 610 Part 2: Encapsulation and network utilities

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

Networking Technologies and Applications

TCP : Fundamentals of Computer Networks Bill Nace

TCP /IP Fundamentals Mr. Cantu

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

Transport Protocols. Raj Jain. Washington University in St. Louis

CS457 Transport Protocols. CS 457 Fall 2014

Packet Header Formats

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

Transport: How Applications Communicate

Lecture 3: The Transport Layer: UDP and TCP

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

User Datagram Protocol (UDP):

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Multiple unconnected networks

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

05 Transmission Control Protocol (TCP)

Network and Security: Introduction

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

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science

Simulation of TCP Layer

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

Position of IP and other network-layer protocols in TCP/IP protocol suite

7. TCP 최양희서울대학교컴퓨터공학부

Applied Networks & Security

Transport Layer Marcos Vieira

QUIZ: Longest Matching Prefix

CS Lecture 1 Review of Basic Protocols

CHAPTER-2 IP CONCEPTS

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

Application. Transport. Network. Link. Physical

EEC-682/782 Computer Networks I

UDP, TCP, IP multicast

Interconnecting Networks with TCP/IP

ITS323: Introduction to Data Communications

4.0.1 CHAPTER INTRODUCTION

The Transport Layer: TCP & Reliable Data Transfer

Goals and topics. Verkkomedian perusteet Fundamentals of Network Media T Circuit switching networks. Topics. Packet-switching networks

Introduction to Networks and the Internet

CSCI-1680 Transport Layer I Rodrigo Fonseca

ECE 650 Systems Programming & Engineering. Spring 2018

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Internet and Intranet Protocols and Applications

UNIT IV -- TRANSPORT LAYER

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

Transport Layer Review

CS4700/CS5700 Fundamentals of Computer Networks

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Computer Communication Networks Midterm Review

Sequence Number. Acknowledgment Number. Data

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

CPSC156a: The Internet Co-Evolution of Technology and Society. Lecture 4: September 16, 2003 Internet Layers and the Web

What is TCP? Transport Layer Protocol

NT1210 Introduction to Networking. Unit 10

6. The Transport Layer and protocols

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

I TCP 1/2. Internet TA: Connection-oriented (virtual circuit) Connectionless (datagram) (flow control) (congestion control) TCP Connection-oriented

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

CSC 634: Networks Programming

Lecture 11: IP routing, IP protocols

TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

The Transmission Control Protocol (TCP)

ECE 435 Network Engineering Lecture 15

Computer Networks and Data Systems

Introduction to Network. Topics

CSCI-1680 Transport Layer I Rodrigo Fonseca

The Internet Protocol (IP)

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

Just enough TCP/IP. Protocol Overview. Connection Types in TCP/IP. Control Mechanisms. Borrowed from my ITS475/575 class the ITL

Sirindhorn International Institute of Technology Thammasat University

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

Ref: A. Leon Garcia and I. Widjaja, Communication Networks, 2 nd Ed. McGraw Hill, 2006 Latest update of this lecture was on

Chapter 5 End-to-End Protocols

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Transcription:

CSCI-GA.2250-001 Operating Systems Networking Hubertus Franke frankeh@cs.nyu.edu

Source: Ganesh Sittampalam NYU

TCP/IP protocol family IP : Internet Protocol UDP : User Datagram Protocol RTP, traceroute TCP : Transmission Control Protocol HTTP, FTP, ssh

What is an internet? A set of interconnected networks The Internet is the most famous example Networks can be completely different Ethernet, ATM, modem, (TCP/)IP is what links them

What is an internet? (cont) Routers (nodes) are devices on multiple networks that pass traffic between them Individual networks pass traffic from one router or endpoint to another TCP/IP hides the details as much as possible

OSI: Open Systems Interconnect OSI and Protocol Stack OSI Model TCP/IP Hierarchy Protocols 7 th Application Layer 6 th Presentation Layer Application Layer 5 th Session Layer 4 th Transport Layer 3 rd Network Layer 2 nd Link Layer 1 st Physical Layer Transport Layer Network Layer Link Layer Link Layer : includes device driver and network interface card Network Layer : handles the movement of packets, i.e. Routing Transport Layer : provides a reliable flow of data between two hosts Application Layer : handles the details of the particular application

Packet Encapsulation The data is sent down the protocol stack Each layer adds to the data by prepending headers 22Bytes 20Bytes 20Bytes 4Bytes 64 to 1500 Bytes

Sender Receiver Application Layer HTTP Request Application Layer HTTP Request Transport Layer TCP HTTP Request Transport Layer TCP HTTP Request Network Layer IP TCP HTTP Request Network Layer IP TCP HTTP Request Data Link Layer Ethernet IP TCP HTTP Request Data Link Layer Ethernet IP TCP HTTP Request Physical Layer Physical Layer

IP Responsible for end to end transmission Sends data in individual packets Maximum size of packet is determined by the networks Fragmented if too large Unreliable Packets might be lost, corrupted, duplicated, delivered out of order

IP addresses 4 bytes e.g. 163.1.125.98 Each device normally gets one (or more) In theory there are about 4 billion available But

Routing How does a device know where to send a packet? All devices need to know what IP addresses are on directly attached networks If the destination is on a local network, send it directly there

Routing (cont) If the destination address isn t local Most non-router devices just send everything to a single local router Routers need to know which network corresponds to each possible IP address

Routing

Allocation of addresses Controlled centrally by ICANN Fairly strict rules on further delegation to avoid wastage Have to demonstrate actual need for them Organizations that got in early have bigger allocations than they really need

IP packets Source and destination addresses Protocol number 1 = ICMP, 6 = TCP, 17 = UDP Various options e.g. to control fragmentation Time to live (TTL) Prevent routing loops

IP Datagram 0 4 8 16 19 24 31 Vers Len TOS Total Length Identification Flags Fragment Offset TTL Protocol Header Checksum Source Internet Address Destination Internet Address Options... Field Purpose Vers IP version number Len Length of IP header (4 octet units) TOS Type of Service T. Length Length of entire datagram (octets) Ident. IP datagram ID (for frag/reassembly) Flags Don t/more fragments Frag Off Fragment Offset Data... Padding Field Purpose TTL Time To Live -Max# of hops Protocol Higher level protocol (1=ICMP, 6=TCP, 17=UDP) Checksum Checksum for the IP header Source IA Originator s Internet Address Dest. IA Final Destination Internet Address Options Source route, time stamp, etc. Data... Higher level protocol data We only looked at the IP addresses, TTL and protocol #

IP Routing Source Application Transport Network Link Router Network Link Destination Application Transport Network Link Routing Table Destination IP address IP address of a next-hop router Flags Network interface specification

UDP Thin layer on top of IP Adds packet length + checksum Guard against corrupted packets Also source and destination ports Ports are used to associate a packet with a specific application at each end Still unreliable: Duplication, loss, out-of-orderness possible

UDP datagram 0 16 31 Source Port Destination Port Length Checksum Application data Field Purpose Source Port 16-bit port number identifying originating application Destination Port 16-bit port number identifying destination application Length Length of UDP datagram (UDP header + data) Checksum Checksum of IP pseudo header, UDP header, and data

Typical applications of UDP Where packet loss etc is better handled by the application than the network stack Where the overhead of setting up a connection isn t wanted VOIP NFS Network File System Most games

TCP Reliable, full-duplex, connection-oriented, stream delivery Interface presented to the application doesn t require data in individual packets Data is guaranteed to arrive, and in the correct order without duplications Or the connection will be dropped Imposes significant overheads

Applications of TCP Most things! HTTP, FTP, Saves the application a lot of work, so used unless there s a good reason not to

TCP implementation Connections are established using a three-way handshake Data is divided up into packets by the operating system Packets are numbered, and received packets are acknowledged Connections are explicitly closed (or may abnormally terminate)

TCP Packets Source + destination ports Sequence number (used to order packets) Acknowledgement number (used to verify packets are received)

TCP Segment 0 4 10 16 19 24 31 Len Source Port Reserved Checksum Sequence Number Acknowledgment Number Flags Options... Data... Destination Port Window Urgent Pointer Padding Field Purpose Source Port Identifies originating application Destination Port Identifies destination application Sequence Number Sequence number of first octet in the segment Acknowledgment # Sequence number of the next expected octet (if ACK flag set) Len Length of TCP header in 4 octet units Flags TCP flags: SYN, FIN, RST, PSH, ACK, URG Window Number of octets from ACK that sender will accept Checksum Checksum of IP pseudo-header + TCP header + data Urgent PointerPointer to end of urgent data Options Special TCP options such as MSS and Window Scale You just need to know port numbers, seq and ack are added

TCP : Data transfer Client Host Timer Send Packet 1 Start Timer ACK would normally Arrive at this time Packet Lost Packet should arrive ACK should be sent Time Expires Timer Retransmit Packet1 Start Timer Receive Packet 1 Send AXK 1 Receive ACK 1 Cancel Timer

IPv6 128 bit addresses Make it feasible to be very wasteful with address allocations Lots of other new features Built-in autoconfiguration, security options, Not really in production use yet

General Structure

Anatomy of Network Stack

Interaction IP Stack / NIC

Linux Tx/Rx Ring handling

TCP/IP Details The sliding window serves several purposes: (1) it guarantees the reliable delivery of data (2) it ensures that the data is delivered in order, (3) it enforces flow control between the sender and the receiver.

Flow Control Max Send and Receive Buffer sizes In order delivery to the consumer Acknowledgement of reception Retransmit when ack is not received in RTT (RoundTripTime) setting

Congestion Control Slow Start Start with 1 congestion window and then doubling it Fast Retransmit When out of order packet is received immediately ACK Fast Recovery

Device Driver Details Receive Switch OS Application read socket Rx netif_receive_skb NET RX Softirq NIC Rx send Port B Rx pause/resume queue Switch Transmit OS Application write socket Tx netif_send_skb NET Driver NIC Tx send Port B Tx pause/resume queue

Some useful general stuff Slab-Cache The primary motivation for slab allocation: initialization and destruction of kernel data objects can actually outweigh the cost of allocating memory for them. As object creation and deletion are widely employed by the kernel, mitigating overhead costs of initialization can result in significant performance gains. object caching was therefore introduced in order to avoid the invocation of functions used to initialize object state. Group same dynamically allocated objects under one allocator object E.g. skb_buff_alloc()

Some useful general stuff General implementation Other features: Coloring Cache utilization

Linux Example of slab caches #> slabtop