Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP/IP Stack Introduction: Looking Under the Hood! Shiv Kalyanaraman Rensselaer Polytechnic Institute.

Slides:



Advertisements
Similar presentations
Socket Programming with IPv6. Why IPv6? Addressing and routing scalability Address space exhaustion Host autoconfiguration QoS of flow using flowlabel.
Advertisements

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5-1 Internet Protocol (IP): Packet Format, Fragmentation, Options Shivkumar Kalyanaraman Rensselaer.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6961:Internet Protocols Quiz 1: Solutions Time: 60 min (strictly enforced) Points: 50 YOUR.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
Shivkumar KalyanaramanRensselaer Q1-1 Internet Protocols: Quiz 1 q This quiz consists of true/false questions for 25 pts and two quantitative problems.
BOOTP and DHCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Informal Quiz 1 True or False? T F  The structure of MAC addresses facilitates performance.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6961:Internet Protocols Quiz 1 Time: 60 min (strictly enforced) Points: 50 YOUR NAME: Be.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Understanding Linux Kernel to Build Software Routers (Qualitative Discussion) Shiv Kalyanaraman,
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
Chapter 3 Review of Protocols And Packet Formats
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Control Message Protocol (ICMP) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
Linux TCP/IP Stack.
ICMP (Internet Control Message Protocol) Computer Networks By: Saeedeh Zahmatkesh spring.
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Control Message Protocol (ICMP) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
Hyung-Min Lee©Networking Lab., 2001 Chapter 11 User Datagram Protocol (UDP)
LWIP TCP/IP Stack 김백규.
January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS NetBSD Kernel Topics: IP Processing mbuf structure Loadable Kernel.
Lecture 3 Review of Internet Protocols Transport Layer.
Examining TCP/IP.
LWIP TCP/IP Stack 김백규.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6600: Internet Protocols Informal Quiz #03 SOLUTIONS Shivkumar Kalyanaraman: GOOGLE: “Shiv.
IP Forwarding.
Router Architecture Overview
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 5 Internet Protocol (IP) Basics.
CS4550 Computer Networks II IP : internet protocol, part 2 : packet formats, routing, routing tables, ICMP read feit chapter 6.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
Network Programming Eddie Aronovich mail:
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6600: Internet Protocols Informal Quiz #14 Shivkumar Kalyanaraman: GOOGLE: “Shiv RPI”
EECB 473 DATA NETWORK ARCHITECTURE AND ELECTRONICS PREPARED BY JEHANA ERMY JAMALUDDIN Basic Packet Processing: Algorithms and Data Structures.
Queues, Pipes and Sockets. QUEUE A structure with a series of data elements with the first element waiting for an operation Used when an element is not.
Monitor- ing, Basic IP Header Proc., Packet Classi- fication and Routing APIC Driver Rcv Side APIC Plugin Ctl. Unit... Resource Controller... Rcv Input.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,
Presented by Rebecca Meinhold But How Does the Internet Work?
1 Introduction to TCP/IP. 2 OSI and Protocol Stack OSI: Open Systems Interconnect OSI ModelTCP/IP HierarchyProtocols 7 th Application Layer 6 th Presentation.
TELE 402 Lecture 12: Signal-Driven I/O & Raw Socket 1 Overview Last Lecture –Advanced UDP sockets and threads –Source: Chapters 22&26 of Stevens’ book.
TCP/IP Illustracted Vol1. 제목 : IP Routing ( 수 ) 한 민 규
1 CSE 5346 Spring Network Simulator Project.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 IP Checksum Calculation At the sender r Set the value of the checksum field to 0. r Divide the header into 16-bit words m Add all segments using one’s.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
Internetworking Multimedia1 TCP/IP Illustrated Volume 2 Chapter 1 Introduction SUNG, Mee Young.
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
UDP. User Datagram Protocol (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports 
SOCKET PROGRAMMING Presented By : Divya Sharma.
Graciela Perera Department of Computer Science and Information Systems Slide 1 of 18 INTRODUCTION NETWORKING CONCEPTS AND ADMINISTRATION CSIS 3723 Graciela.
Introduction to Networks
Chapter 11 User Datagram Protocol
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Introduction to TCP/IP
LWIP TCP/IP Stack 김백규.
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Reference Router on NetFPGA 1G
Internet Protocol (IP)
Wide Area Networks and Internet CT1403
Chapter 4 Network Layer Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April Network Layer.
Network Layer: Control/data plane, addressing, routers
46 to 1500 bytes TYPE CODE CHECKSUM IDENTIFIER SEQUENCE NUMBER OPTIONAL DATA ICMP Echo message.
Reference Router on NetFPGA 1G
Presentation transcript:

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP/IP Stack Introduction: Looking Under the Hood! Shiv Kalyanaraman Rensselaer Polytechnic Institute Google: “SHIV RPI”

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 2 Example program q 1. Create UDP datagram socket; fill in server address q 2. Send datagram to a server q 3. Read datagram returned by server

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 3 Example Program: UDP Datagram

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 4 Organization of Networking Code Protocol Independent Layer

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5 Descriptor  Kernel Data Structures

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 6 Descriptors q Socket: is like other UNIX descriptors q Can read(), write(), dup(), fcntl(), close(); shared between parent and child after fork() q Socket descriptor  file{}  socket{} q Fileops{}: convenient place for socket operations q Doubly linked list of protocol control blocks (PCBs) q Sendto: Access PCBs in top-down manner q Receive: PCBs searched for port-number; then socket{} accessed through inp_socket

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 7 Kernel Data Structures

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 8 Memory Buffers (mbufs) q Used for passing socket address structs, data etc q 128-bytes, with 20 byte mbuf header q Mbuf chain with mbuf packet header q m_next: links mbufs within a packet q m_nextpkt: links multiple pkts (queue of mbufs) q 2048-byte clusters used if data > 208 bytes

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 9 Example: mbuf chain with data q 150 bytes of data divided into 2 mbufs: bytes q Note: pkthdr fields (and mflags = M_PKTHDR) only in first mbuf

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 10 Mbufs: header and data q Protocol (IP +UDP) headers prepended in another mbuf (avoid copies in future)! q Pkthdr fields moved to first mbuf in this new chain. q Headers are in the end of the first mbuf: allows space for ethernet header prepending q M_data points to appropriate location

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 11 TCP/IP Stack

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 12 Output Functions at Various Levels q UDP output routine fills in UDP header and as much of the IP header as possible (eg: IP chksum not filled; but destination address & UDP checksum filled) q 2 copy passes on 150 bytes of data so far: q A) to copy from process to kernel mbuf; q B) to compute UDP checksum q IP fills in remaining fields, determines outgoing interface, fragments IP datagram if necessary, and calls the interface output function q Ethernet output: converts IP addr to Ethernet address (ARP); prepend 14-byte Enet header; add mbuf chain to output queue for interface; “start” interface if not busy. q Interface copies data to transmit buffer (3 rd copy pass), initiates output & release mbuf chain

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 13 Input processing q Recvfrom(): input is asynchronous:interrupt driven & not system-call driven q Device interrupt => ethernet device driver scheduled q Ethernet driver reads data into an mbuf chain (in our case 54 bytes received: 26 byte payload, 28 bytes of UDP/IP headers) q Pkthdr.rcvif field in mbuf points to interface structure (used only for input) q Device driver passes mbuf to a general Ethernet input routine which does de-multiplexing based upon the type field. q Add to IP queue, and schedule a software interrupt for IP q IP input triggered by software interrupt. q IP processes each datagram in its input queue: verifies chksum, processes IP options, sanity checks. q Either forward pkt (if router), else demux it to the appropriate protocol (UDP) q UDP sanity checks, decides whether a process should receive dgram. q Goes thru UDP PCBs looking for inp_lport (local port) & append two mbufs to socket receive queue

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 14 Mbufs in Socket Receive Queue q 1 st mbuf: MT_SONAME q The length fields refer to the data only (just a quick pointer manipulation based upon fig 1.10)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 15 Functions to block interrupts

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 16 Interrupt Priority Levels Device interrupt -> interface layer executes … Software interrupt -> protocol layer executes… then the socket code executes…