Contents. Part 1. Introduction and TCP/IP 1. Foreword Preface. xix. I ntroduction 31

Size: px
Start display at page:

Download "Contents. Part 1. Introduction and TCP/IP 1. Foreword Preface. xix. I ntroduction 31"

Transcription

1 Foreword Preface Xvii xix Part 1. Introduction and TCP/IP 1 Chapter Chapter I ntroduction I ntroduction 3 A Simple Daytime Client 6 Protocol Independence 10 Error Handling: Wrapper Functions 11 A Simple Daytime Server 13 Roadmap to Client/Server Examples in the Text OSI Model 18 BSD Networking History 20 Test Networks and Hosts 22 Unix Standards Bit Architectures 28 Summary 29 The Transport Layer: TCP, UDP, and SCTP I ntroduction 31 The Big Picture 32 User Datagram Protocol (UDP) Vii

2 UNIX Network Programming Transmission Control Protocol (TCP) 35 Stream Control Transmission Protocol (SCTP) 36 TCP Connection Establishment and Termination 37 TIME WAIT State 43 SCTP Association Establishment and Termination 44 Port Numbers 50 TCP Port Numbers and Concurrent Servers 52 Buffer Sizes and Limitations 55 Standard Internet Services 61 Protocol Usage by Common Internet Applications 62 Summary 63 Part 2. Elementary Sockets 65 Chapter Sockets Introduction I ntroduction 67 Socket Address Structures 67 Value-Result Arguments 74 Byte Ordering Functions 77 Byte Manipulation Functions 80 inet _ aton, inet _ addr, and inet _ ntoa Functions inet_pton and inet _ ntop Functions 83 sock ntop and Related Functions 86 readn, writen, and readline Functions 88 Summary Chapter Chapter Elementary TCP Sockets I ntroduction 95 socket Function 95 connect Function 99 bind Function 101 listen Function 104 accept Function 109 fork and exec Functions 111 Concurrent Servers 114 close Function 117 getsockname and getpeername Functions Summary 120 TCP Client/Server Example I ntroduction 121 TCP Echo Server: main Function 122 TCP Echo Server: str _ echo Function 123 TCP Echo Client: main Function 124 TCP Echo Client: str _ cli Function 125 Normal Startup 126 Normal Termination

3 UNIX Network Programming ix POSIX Signal Handling 129 Handling SIGCHLD Signals 132 wait and waitpid Functions 135 Connection Abort before accept Returns Termination of Server Process 141 SIGPIPE Signal 142 Crashing of Server Host 144 Crashing and Rebooting of Server Host Shutdown of Server Host 145 Summary of TCP Example 146 Data Format 147 Summary Chapter Chapter Chapter UO Multiplexing: The select and poll Functions I ntroduction 153 I/O Models 154 select Function 160 str _ cli Function (Revisited) 167 Batch Input and Buffering 169 shutdown Function 172- str _ cli Function (Revisited Again) 173 TCP Echo Server (Revisited) 175 pselect Function 181 poll Function 182 TCP Echo Server (Revisited Again) 185 Summary 188 Socket Options I ntroduction 191 getsockopt and setsockopt Functions 192 Checking if an Option Is Supported and Obtaining the Default Socket States 198 Generic Socket Options 198 I Pv4 Socket Options 214 I CMPv6 Socket Option 216 I Pv6 Socket Options 216 TCP Socket Options 219 SCTP Socket Options 222 fcntl Function 233 Summary 236 Elementary UDP Sockets I ntroduction 239 recvfrom and sendto Functions 240 UDP Echo Server: main Function 241 UDP Echo Server: dg echo Function 242 UDP Echo Client: main Function 244 UDP Echo Client: dg cli Function

4 UNIX Network Programming Chapter Chapter Lost Datagrams 245 Verifying Received Response 246 Server Not Running 248 Summary of UDP Example 250 connect Function with UDP 252 dg cli Function (Revisited) 256 Lack of Flow Control with UDP 257 Determining Outgoing Interface with UDP 261 TCP and UDP Echo Server Using select 262 Summary 264 Elementary SCTP Sockets I ntroduction 267 I nterface Models 268 sctp bindx Function 272 sctp connectx Function 274 sctp getpaddrs Function 275 sctp freepaddrs Function 275 sctp getladdrs Function 275 sctp _ freeladdrs Function 276 sctp_sendmsg Function 276 sctp recvmsg Function 277 sctp opt_ info Function 278 sctp_peeloff Function 278 shutdown Function 278 Notifications 280 Summary 286 SCTP Client/Server Example I ntroduction 287 SCTP One-to-Many-Style Streaming Echo Server: main Function SCTP One-to-Many-Style Streaming Echo Client: main Function SCTP Streaming Echo Client: str _ cli Function 292 Exploring Head-of-Line Blocking 293 Controlling the Number of Streams 299 Controlling Termination 300 Summary Chapter 11. Name and Address Conversions 11.1 I ntroduction Domain Name System (DNS) gethostbyname Function gethostbyaddr Function getservbyname and getservbyport 11.6 getaddrinfo Function gai strerror Function freeaddrinfo Function getaddrinfo Function: IPv6 322 Functions

5 UNIX Network Programming xi getaddrinfo Function: Examples host _ serv Function tcp connect Function tcp listen Function udp client Function udp connect Function udp_ server Function getnameinfo Function Re-entrant Functions gethostbyname_r and gethostbyaddr r Functions Obsolete IPv6 Address Lookup Functions Other Networking Information Summary Part 3. Advanced Sockets 351 Chapter I Pv4 and IPv6 Interoperability I ntroduction 353 I Pv4 Client, IPv6 Server 354 I Pv6 Client, IPv4 Server 357 l Pv6 Address-Testing Macros 360 Source Code Portability 361 Summary Chapter Daemon Processes and the inetd Superserver I ntroduction 363 syslogd Daemon 364 syslog Function 365 daemon _ init Function 367 inetd Daemon 371 daemon _ inetd Function 377 Summary Chapter 14. Advanced I/O Functions 14.1 I ntroduction Socket Timeouts recv and send Functions ready and writev Functions recvmsg and sendmsg Functions Ancillary Data How Much Data Is Queued? Sockets and Standard I/O Advanced Polling Summary

6 xii UNIX Network Programming Chapter Chapter Unix Domain Protocols I ntroduction 411 Unix Domain Socket Address Structure 412 socketpair Function 414 Socket Functions 415 Unix Domain Stream Client/Server 416 Unix Domain Datagram Client/Server 418 Passing Descriptors 420 Receiving Sender Credentials 429 Summary 432 Nonblocking I/O I ntroduction 435 Nonblocking Reads and Writes: str_cli Function (Revisited) Nonblocking connect 448 Nonblocking connect: Daytime Client 449 Nonblocking connect: Web Client 452 Nonblocking accept 461 Summary Chapter 17. ioctl Operations 17.1 I ntroduction ioctl Function Socket Operations File Operations I nterface Configuration get_ifi _ info Function I nterface Operations ARP Cache Operations Routing Table Operations Summary Chapter Routing Sockets I ntroduction 485 Datalink Socket Address Structure Reading and Writing 487 sysctl Operations 495 get_ifi _ info Function (Revisited) I nterface Name and Index Functions Summary Chapter Key Management Sockets I ntroduction 511 Reading and Writing 512 Dumping the Security Association Database (SADB) Creating a Static Security Association (SA) 517 Dynamically Maintaining SAs 524 Summary

7 UNIX Network Programming xiii Chapter Broadcasting I ntroduction 529 Broadcast Addresses 531 Unicast versus Broadcast 532 dg_cli Function Using Broadcasting Race Conditions 538 Summary Chapter 21. Multicasting 21.1 Introduction Multicast Addresses Multicasting versus Broadcasting on a LAN Multicasting on a WAN Source-Specific Multicast Multicast Socket Options mcast_join and Related Functions dg_cli Function Using Multicasting Receiving IP Multicast Infrastructure Session Announcements Sending and Receiving Simple Network Time Protocol (SNTP) Summary 584 Chapter 22. Advanced UDP Sockets 22.1 I ntroduction Receiving Flags, Destination IP Address, and Interface Index 22.3 Datagram Truncation When to Use UDP Instead of TCP Adding Reliability to a UDP Application Binding Interface Addresses Concurrent UDP Servers I Pv6 Packet Information IPv6 Path MTU Control Summary Chapter 23. Advanced SCTP Sockets 23.1 I ntroduction An Autoclosing One-to-Many-Style Server Partial Delivery Notifications Unordered Data Binding a Subset of Addresses Determining Peer and Local Address Information 23.8 Finding an Association ID Given an IP Address 23.9 Heartbeating and Address Failure Peeling Off an Association Controlling Timing When to Use SCTP Instead of TCP Summary

8 xiv UNIX Network Programming Chapter Out-of-Band Data I ntroduction 645 TCP Out-of-Band Data 645 sockat.mark Function 654 TCP Out-of-Band Data Recap Summary Chapter 25. Signal-Driven 1/O 25.1 I ntroduction Signal-Driven I/O for Sockets UDP Echo Server Using SIGIO Summary Chapter 26. Threads 26.1 I ntroduction Basic Thread Functions: Creation and Termination str _ cli Function Using Threads TCP Echo Server Using Threads Thread-Specific Data Web Client and Simultaneous Connections (Continued) 26.7 Mutexes: Mutual Exclusion Condition Variables Web Client and Simultaneous Connections (Continued) Summary Chapter I P Options I ntroduction 709 I Pv4 Options 709 I Pv4 Source Route Options 711 I Pv6 Extension Headers 719 I Pv6 Hop-by-Hop Options and Destination Options I Pv6 Routing Header 725 I Pv6 Sticky Options 731 Historical IPv6 Advanced API 732 Summary Chapter Raw Sockets I ntroduction 735 Raw Socket Creation 736 Raw Socket Output 737 Raw Socket Input 739 ping Program 741 traceroute Program 755 An ICMP Message Daemon Summary

9 UNIX Network Programming xv Chapter Datalink Access I ntroduction 787 BSD Packet Filter (BPF) 788 Datalink Provider Interface (DLPI) 790 Linux: SOCK _ PACKET and PF _ PACKET 791 libpcap: Packet Capture Library 792 libnet: Packet Creation and Injection Library Examining the UDP Checksum Field 793 Summary Chapter 30. Client/Server Design Alternatives 30.1 I ntroduction TCP Client Alternatives TCP Test Client TCP Iterative Server TCP Concurrent Server, One Child per Client TCP Preforked Server, No Locking Around accept TCP Preforked Server, File Locking Around accept TCP Preforked Server, Thread Locking Around accept TCP Preforked Server, Descriptor Passing TCP Concurrent Server, One Thread per Client TCP Prethreaded Server, per-thread accept TCP Prethreaded Server, Main Thread accept Summary Chapter STREAMS I ntroduction 851 Overview 851 getmsg and putmsg Functions getpmsg and putpmsg Functions ioctl Function 857 Transport Provider Interface (TPI) Summary Appendix A. IPv4, lpv6, ICMPv4, and ICMPv6 A.1 I ntroduction 869 A.2 IPv4 Header 869 A.3 IPv6 Header 871 A.4 I Pv4 Addresses 874 A.5 I Pv6 Addresses 877 A.6 I nternet Control Message Protocols (ICMPv4 and ICMPv6) Appendix B. Virtual Networks B.1 I ntroduction 885 B.2 The MBone 885 B.3 The 6bone 887 B.4 I Pv6 Transition: 6to

10 xvi UNIX Network Programming Appendix C. Debugging Techniques C.1 System Call Tracing 891 C.2 Standard Internet Services C.3 sock Program 893 C.4 Small Test Programs 896 C.5 tcpdump Program 896 C.6 netstat Program 896 C.7 lsof Program Appendix D. D.1 D.2 D.3 Miscellaneous Source Code unp. h Header 899 conf ig. h Header 904 Standard Error Functions Appendix E. Solutions to Selected Exercises 913 Bibliography 947 Index 955

UNIX Network Programming

UNIX Network Programming UNIX Network Programming The Sockets Networking API Volume 1 Third Edition W. Richard Stevens Bill Fenner Andrew M. Rudoff AAddison-Wesley Boston San Francisco New York Toronto Montreal London Munich Paris

More information

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK UNIT 1

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK UNIT 1 CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK SUBJECT: NETWORK PROGRAMMING/MC9241 YEAR/ SEM: II /I V 1 CCET UNIT 1 1. What are the steps involved in obtaining a shared

More information

LESSON PLAN. Sub. Code & Name : IT2351 & Network Programming and Management Unit : I Branch: IT Year : III Semester: VI.

LESSON PLAN. Sub. Code & Name : IT2351 & Network Programming and Management Unit : I Branch: IT Year : III Semester: VI. Unit : I Branch: IT Year : III Semester: VI Page: 1 of 6 UNIT I ELEMENTARY TCP SOCKETS 9 Introduction to Socket Programming Overview of TCP/IP Protocols Introduction to Sockets Socket address Structures

More information

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur QUESTION BANK

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur QUESTION BANK SRM Nagar, Kattankulathur 603 203 IV SEMESTER MC7404 NETWORK PROGRAMMING Regulation 2013 Academic Year 2017 18 Prepared by Mr. M.Asan Nainar, Assistant Professor/MCA UNIT I - INTRODUCTION Overview of UNIX

More information

NETWORK PROGRAMMING AND MANAGEMENT 1 KINGS DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

NETWORK PROGRAMMING AND MANAGEMENT 1 KINGS DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK NETWORK PROGRAMMING AND MANAGEMENT 1 KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK Subject Code & Name: Network Programming and Management Year / Sem : III / VI UNIT-

More information

Computer Networks SYLLABUS CHAPTER - 2 : NETWORK LAYER CHAPTER - 3 : INTERNETWORKING

Computer Networks SYLLABUS CHAPTER - 2 : NETWORK LAYER CHAPTER - 3 : INTERNETWORKING i SYLLABUS UNIT - 1 CHAPTER - 1 : INTRODUCTION Uses of Computer Networks, Network Hardware, Network Software, Reference Models (ISO-OSI, TCP/IP). CHAPTER - 2 : NETWORK LAYER Network Layer Design Issues,

More information

Lecture 5 Overview! Last Lecture! This Lecture! Next Lecture! I/O multiplexing! Source: Chapter 6 of Stevens book!

Lecture 5 Overview! Last Lecture! This Lecture! Next Lecture! I/O multiplexing! Source: Chapter 6 of Stevens book! Lecture 5 Overview! Last Lecture! I/O multiplexing! Source: Chapter 6 of Stevens book! This Lecture! Socket options! Source: Chapter 7 of Stevens book! Elementary UDP sockets! Source: Chapter 8 of Stevens

More information

Motivation of VPN! Overview! VPN addressing and routing! Two basic techniques for VPN! ! How to guarantee privacy of network traffic?!

Motivation of VPN! Overview! VPN addressing and routing! Two basic techniques for VPN! ! How to guarantee privacy of network traffic?! Overview!! Last Lecture!! Daemon processes and advanced I/O functions!! This Lecture!! VPN, NAT, DHCP!! Source: Chapters 19&22 of Comer s book!! Unix domain protocols and non-blocking I/O!! Source: Chapters

More information

CptS 360 (System Programming) Unit 17: Network IPC (Sockets)

CptS 360 (System Programming) Unit 17: Network IPC (Sockets) CptS 360 (System Programming) Unit 17: Network IPC (Sockets) Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2018 Motivation Processes need to talk to each other

More information

Overview. Last Lecture. This Lecture. Daemon processes and advanced I/O functions

Overview. Last Lecture. This Lecture. Daemon processes and advanced I/O functions Overview Last Lecture Daemon processes and advanced I/O functions This Lecture Unix domain protocols and non-blocking I/O Source: Chapters 15&16&17 of Stevens book Unix domain sockets A way of performing

More information

Introduction! Overview! Signal-driven I/O for Sockets! Two different UDP servers!

Introduction! Overview! Signal-driven I/O for Sockets! Two different UDP servers! Overview Last Lecture Advanced UDP sockets and threads Source: Chapters 22&26 of Stevens book This Lecture Signal-driven I/O, Raw sockets Source: Chapters 25&28&29 of Stevens book Next Lecture WSN and

More information

UNIT IV- SOCKETS Part A

UNIT IV- SOCKETS Part A 1. Define sockets - SOCKETS Part A A socket is a construct to provide a communication between computers. It hides the underlying networking concepts and provides us with an interface to communicate between

More information

Light & NOS. Dan Li Tsinghua University

Light & NOS. Dan Li Tsinghua University Light & NOS Dan Li Tsinghua University Performance gain The Power of DPDK As claimed: 80 CPU cycles per packet Significant gain compared with Kernel! What we care more How to leverage the performance gain

More information

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags Outline SWE 545 Socket Options POSIX name/address conversion Out-of-Band Data Advanced Socket Programming 2 Socket Options Various attributes that are used to determine the behavior of sockets Setting

More information

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University Computer Network Programming The Transport Layer Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University The Transport Layer The Big Picture Overview of TCP/IP protocols TCP Packet Exchanges

More information

Introduction... xiii Chapter 1: Introduction to Computer Networks and Internet Computer Networks Uses of Computer Networks...

Introduction... xiii Chapter 1: Introduction to Computer Networks and Internet Computer Networks Uses of Computer Networks... Table of Contents Introduction... xiii Chapter 1: Introduction to Computer Networks and Internet... 1 1.1 Computer Networks... 1 1.1.1 Advantages of Computer Networks... 2 1.1.2 Disadvantages of Computer

More information

Internetworking With TCP/IP

Internetworking With TCP/IP Internetworking With TCP/IP Vol II: Design, Implementation, and Internals SECOND EDITION DOUGLAS E. COMER and DAVID L. STEVENS Department of Computer Sciences Purdue University West Lafayette, IN 47907

More information

IPv4 and ipv6 INTEROPERABILITY

IPv4 and ipv6 INTEROPERABILITY IT2351-NPM/UNIT-4/ 1 IPv4 and ipv6 INTEROPERABILITY Till the time, IPv6 is established all over the world, there is a need for one to host dual stacks that is both IPv4 and IPv6 are running concurrently

More information

NETWORK PROGRAMMING. Ipv4 and Ipv6 interoperability

NETWORK PROGRAMMING. Ipv4 and Ipv6 interoperability NETWORK PROGRAMMING UNIT V ADVANCED SOCKETS Ipv4 and Ipv6 interoperability threaded servers thread creation and termination TCP echo server using threads Mutexes condition variables raw sockets raw socket

More information

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

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers Layer 4: UDP, TCP, and others based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers Concepts application set transport set High-level, "Application Set" protocols deal only with how handled

More information

Overview. Daemon processes and advanced I/O. Source: Chapters 13&14 of Stevens book

Overview. Daemon processes and advanced I/O. Source: Chapters 13&14 of Stevens book Overview Last Lecture Broadcast and multicast This Lecture Daemon processes and advanced I/O functions Source: Chapters 13&14 of Stevens book Next Lecture Unix domain protocols and non-blocking I/O Source:

More information

CS631 - Advanced Programming in the UNIX Environment Interprocess Communication II

CS631 - Advanced Programming in the UNIX Environment Interprocess Communication II CS631 - Advanced Programming in the UNIX Environment Slide 1 CS631 - Advanced Programming in the UNIX Environment Interprocess Communication II Department of Computer Science Stevens Institute of Technology

More information

Internetworking With TCP/IP

Internetworking With TCP/IP Internetworking With TCP/IP Vol II: Design, Implementation, and Internais DOUGLAS E. COMER and DAVID L. STEVENS Department of Computer Sciences Purdue University West Lafayette, IN 47907 PRENTICE HALL

More information

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Lecture 3. The Network Layer (cont d) Network Layer 1-1 Lecture 3 The Network Layer (cont d) Network Layer 1-1 Agenda The Network Layer (cont d) What is inside a router? Internet Protocol (IP) IPv4 fragmentation and addressing IP Address Classes and Subnets

More information

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

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science NETWORK PROGRAMMING CSC- 341 Instructor: Junaid Tariq, Lecturer, Department of Computer Science 6 Lecture CHAPTER 2: THE TRANSPORT LAYER : TCP AND UDP Contents Introduction UDP: User Datagram Protocol

More information

Z/TPF TCP/IP SOCK Driver 12/14/10. z/tpf TCP/IP SOCKET Driver Users Guide. Copyright IBM Corp. 2010

Z/TPF TCP/IP SOCK Driver 12/14/10. z/tpf TCP/IP SOCKET Driver Users Guide. Copyright IBM Corp. 2010 z/tpf TCP/IP SOCKET Driver Users Guide Copyright IBM Corp. 2010 1. 1.0 Introduction Z/TPF TCP/IP SOCK Driver 12/14/10 The socket driver consists of multiple DLMs that issue TCP/IP API calls to send and

More information

Lecture Plan-1. Contents Methodology Time Queries Remarks. Question/ Answers. Discussion. Chalk Board. &Discussion. Discussion 10

Lecture Plan-1. Contents Methodology Time Queries Remarks. Question/ Answers. Discussion. Chalk Board. &Discussion. Discussion 10 Lecture Plan-1 Objective:- to networking. 2. to basics of networking. 10 OSI & TCP/IP Communication model in detail. & 20 10 Lecture Plan 2 Objective:-. Understanding the TC/IP Protocol architecture &

More information

CS UDP: User Datagram Protocol, Other Transports, Sockets. congestion worse);

CS UDP: User Datagram Protocol, Other Transports, Sockets. congestion worse); CS314-26 UDP: User Datagram Protocol, Other Transports, Sockets! IP is an unreliable datagram protocol " congestion or transmission errors cause lost packets " multiple routes may lead to out-of-order

More information

Linux Kernel Application Interface

Linux Kernel Application Interface Linux Kernel Application Interface Arseny Kurnikov Aalto University School of Electrical Engineering PO Box 13000, FI-00076 Aalto Espoo, Finland arseny.kurnikov@aalto.fi ABSTRACT This paper describes different

More information

Lecture 10 Overview!

Lecture 10 Overview! Lecture 10 Overview! Last Lecture! Wireless Sensor Networks! This Lecture! Daemon processes and advanced I/O functions! Source: Chapters 13 &14 of Stevens book! Next Lecture! Unix domain protocols and

More information

Network Programming. Introduction to Sockets. Dr. Thaier Hayajneh. Process Layer. Network Layer. Berkeley API

Network Programming. Introduction to Sockets. Dr. Thaier Hayajneh. Process Layer. Network Layer. Berkeley API Network Programming Outline Definitions Dr. Thaier Hayajneh Computer Engineering Department Berkeley API Socket definition and types Introduction to Sockets 1 2 Process Process Process Layer TCP SCTP UDP

More information

Lecture 8. Network Layer (cont d) Network Layer 1-1

Lecture 8. Network Layer (cont d) Network Layer 1-1 Lecture 8 Network Layer (cont d) Network Layer 1-1 Agenda The Network Layer (cont d) What is inside a router Internet Protocol (IP) IPv4 fragmentation and addressing IP Address Classes and Subnets Network

More information

Operating Systems. 17. Sockets. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Operating Systems. 17. Sockets. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski Operating Systems 17. Sockets Paul Krzyzanowski Rutgers University Spring 2015 1 Sockets Dominant API for transport layer connectivity Created at UC Berkeley for 4.2BSD Unix (1983) Design goals Communication

More information

Foundations of Python

Foundations of Python Foundations of Python Network Programming The comprehensive guide to building network applications with Python Second Edition Brandon Rhodes John Goerzen Apress Contents Contents at a Glance About the

More information

ICS 351: Networking Protocols

ICS 351: Networking Protocols ICS 351: Networking Protocols IP packet forwarding application layer: DNS, HTTP transport layer: TCP and UDP network layer: IP, ICMP, ARP data-link layer: Ethernet, WiFi 1 Networking concepts each protocol

More information

MARIA COLLEGE OF ENGINEERING AND TECHNOLOGY, ATTOOR DEPARTMENT OF INFORMATION TECHNOLOGY NETWORK PROGRAMMING MANAGEMENT 2 MARKS QUESTIONS & ANSWERS

MARIA COLLEGE OF ENGINEERING AND TECHNOLOGY, ATTOOR DEPARTMENT OF INFORMATION TECHNOLOGY NETWORK PROGRAMMING MANAGEMENT 2 MARKS QUESTIONS & ANSWERS MARIA COLLEGE OF ENGINEERING AND TECHNOLOGY, ATTOOR DEPARTMENT OF INFORMATION TECHNOLOGY NETWORK PROGRAMMING MANAGEMENT 2 MARKS QUESTIONS & ANSWERS 1. What is a socket? UNIT-I TWO MARKS A socket is a logical

More information

Stream Control Transmission Protocol (SCTP)

Stream Control Transmission Protocol (SCTP) Stream Control Transmission Protocol (SCTP) Definition Stream control transmission protocol (SCTP) is an end-to-end, connectionoriented protocol that transports data in independent sequenced streams. SCTP

More information

Network programming(ii) Lenuta Alboaie

Network programming(ii) Lenuta Alboaie Network programming(ii) Lenuta Alboaie adria@info.uaic.ro 1 Content let s remember: iterative TCP client/server UDP client/server model I/O primitives Advanced programming aspects in Internet socket API

More information

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

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link. Internet Layers Application Application Transport Transport Network Network Network Network Link Link Link Link Ethernet Fiber Optics Physical Layer Wi-Fi ARP requests and responses IP: 192.168.1.1 MAC:

More information

Chapter 8: I/O functions & socket options

Chapter 8: I/O functions & socket options Chapter 8: I/O functions & socket options 8.1 Introduction I/O Models In general, there are normally two phases for an input operation: 1) Waiting for the data to arrive on the network. When the packet

More information

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length)

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length) File Systems 38 Memory-Mapped Files generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length) mmap call returns the virtual address to which the file is mapped munmap call unmaps

More information

A Client-Server Exchange

A Client-Server Exchange Socket programming A Client-Server Exchange A server process and one or more client processes Server manages some resource. Server provides service by manipulating resource for clients. 1. Client sends

More information

Interprocess Communication Mechanisms

Interprocess Communication Mechanisms Interprocess Communication 1 Interprocess Communication Mechanisms shared storage These mechanisms have already been covered. examples: shared virtual memory shared files processes must agree on a name

More information

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals Interprocess Communication 1 Interprocess Communication Mechanisms shared storage These mechanisms have already been covered. examples: shared virtual memory shared files processes must agree on a name

More information

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division SECOND SEMESTER 2017-2018 Course Handout (Part II) Jan 08, 2017 In addition to part-i (General handout for all courses appended to the timetable) this portion gives further specific details regarding the

More information

Foreword xxiii Preface xxvii IPv6 Rationale and Features

Foreword xxiii Preface xxvii IPv6 Rationale and Features Contents Foreword Preface xxiii xxvii 1 IPv6 Rationale and Features 1 1.1 Internet Growth 1 1.1.1 IPv4 Addressing 1 1.1.2 IPv4 Address Space Utilization 3 1.1.3 Network Address Translation 5 1.1.4 HTTP

More information

Step 2. Manual configuration of global unicast and link-local addresses

Step 2. Manual configuration of global unicast and link-local addresses Lab: ICMPv6 and ICMPv6 Neighbor Discovery CIS 116 IPv6 Fundamentals Enter your answers to the questions in this lab using Canvas Quiz DHCPv6 Lab. Part 1: Setup Step 1. Basics a. Log into NetLab: ccnp.bayict.cabrillo.edu

More information

Advanced Programming in the UNIX Environment W. Richard Stevens

Advanced Programming in the UNIX Environment W. Richard Stevens Advanced Programming in the UNIX Environment W. Richard Stevens ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam

More information

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

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

More information

History Page. Barracuda NextGen Firewall F

History Page. Barracuda NextGen Firewall F The Firewall > History page is very useful for troubleshooting. It provides information for all traffic that has passed through the Barracuda NG Firewall. It also provides messages that state why traffic

More information

IPv6 Core Protocols Implementation

IPv6 Core Protocols Implementation IPv6 Core Protocols Implementation Qing Li Blue Coat Systems, Inc. Tatuya Jinmei Toshiba Corporation Keiichi Shima Internet Initiative Japan, Inc. ii.x'l J ELSEVIER AMSTERDAM BOSTON HEIDELBERG LONDON NEW

More information

User Datagram Protocol

User Datagram Protocol Topics Transport Layer TCP s three-way handshake TCP s connection termination sequence TCP s TIME_WAIT state TCP and UDP buffering by the socket layer 2 Introduction UDP is a simple, unreliable datagram

More information

ETSF05/ETSF10 Internet Protocols Network Layer Protocols

ETSF05/ETSF10 Internet Protocols Network Layer Protocols ETSF05/ETSF10 Internet Protocols Network Layer Protocols 2016 Jens Andersson Agenda Internetworking IPv4/IPv6 Framentation/Reassembly ICMPv4/ICMPv6 IPv4 to IPv6 transition VPN/Ipsec NAT (Network Address

More information

UNIT III - APPLICATION DEVELOPMENT. TCP Echo Server

UNIT III - APPLICATION DEVELOPMENT. TCP Echo Server UNIT III - APPLICATION DEVELOPMENT TCP Echo Server TCP Echo Client Posix Signal handling Server with multiple clients boundary conditions: Server process Crashes, Server host Crashes, Server Crashes and

More information

(Refer Slide Time: 1:09)

(Refer Slide Time: 1:09) Computer Networks Prof. S. Ghosh Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecturer # 30 UDP and Client Server Good day, today we will start our discussion

More information

Linux Kernel Application Interface

Linux Kernel Application Interface Linux Kernel Application Interface Arseny Kurnikov Aalto University School of Electrical Engineering PO Box 13000, FI-00076 Aalto Espoo, Finland arseny.kurnikov@aalto.fi ABSTRACT This paper describes different

More information

Agenda. Before we start: Assignment #1. Routing in a wide area network. Protocols more concepts. Internetworking. Congestion control

Agenda. Before we start: Assignment #1. Routing in a wide area network. Protocols more concepts. Internetworking. Congestion control Agenda Last time (Tues) No class Tuesday Jan 30 (Marty at conference) Will be made up Thurs Feb 8 / Fri Feb 9 This time Continue with Networks (chpt 3) Interprocess Communication (chpt 4) 1 st HW/PA out

More information

CSC 634: Networks Programming

CSC 634: Networks Programming CSC 634: Networks Programming Lecture 03: Review of Basic Networking Concepts (TCP/UDP) Instructor: Haidar M. Harmanani Recap 7-Layer OSI Model 7 6 5 4 3 2 1 Application Presentation (kinds of compression)

More information

Vorlesung Kommunikationsnetze

Vorlesung Kommunikationsnetze Picture 15 13 Vorlesung Kommunikationsnetze Prof. Dr. H. P. Großmann mit B. Wiegel sowie A. Schmeiser und M. Rabel Sommersemester 2009 Institut für Organisation und Management von Informationssystemen

More information

ICS 451: Today's plan

ICS 451: Today's plan ICS 451: Today's plan ICMP ping traceroute ARP DHCP summary of IP processing ICMP Internet Control Message Protocol, 2 functions: error reporting (never sent in response to ICMP error packets) network

More information

Lecture 11: IP routing, IP protocols

Lecture 11: IP routing, IP protocols Lecture 11: IP routing, IP protocols Contents Routing principles Local datagram delivery ICMP Protocol UDP Protocol TCP/IP Protocol Assuring requirements for streaming TPC Building and terminating TCP

More information

TCP /IP Fundamentals Mr. Cantu

TCP /IP Fundamentals Mr. Cantu TCP /IP Fundamentals Mr. Cantu OSI Model and TCP/IP Model Comparison TCP / IP Protocols (Application Layer) The TCP/IP subprotocols listed in this layer are services that support a number of network functions:

More information

Interprocess Communication

Interprocess Communication Interprocess Communication B.Ramamurthy CSE421 11/5/02 B.R 1 Topics Pipes (process level) Sockets (OS level) Distributed System Methods (Java s) Remote Method Invocation (PL Level) Other communication

More information

ETSF10 Internet Protocols Network Layer Protocols

ETSF10 Internet Protocols Network Layer Protocols ETSF10 Internet Protocols Network Layer Protocols 2012, Part 2, Lecture 3.1 Kaan Bür, Jens Andersson Network Layer Protocols IPv4, IPv6 [ed.4 ch.20.3+19.2] [ed.5 ch.22.1.1-2+22.2] Transition from IPv4

More information

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016 TRANSMISSION CONTROL PROTOCOL ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016 ETI 2506 - TELECOMMUNICATION SYLLABUS Principles of Telecom (IP Telephony and IP TV) - Key Issues to remember 1.

More information

Preface to the First Edition Preface to the Second Edition Acknowledgments UNIX Operating System Environment p. 1 UNIX: Past and Present p.

Preface to the First Edition Preface to the Second Edition Acknowledgments UNIX Operating System Environment p. 1 UNIX: Past and Present p. Preface to the First Edition p. xv Preface to the Second Edition p. xvii Acknowledgments p. xix UNIX Operating System Environment p. 1 UNIX: Past and Present p. 2 History and Growth of UNIX p. 2 Flavors

More information

Brief Contents. Acknowledgments... xv. Introduction...xvii. Chapter 1: Packet Analysis and Network Basics Chapter 2: Tapping into the Wire...

Brief Contents. Acknowledgments... xv. Introduction...xvii. Chapter 1: Packet Analysis and Network Basics Chapter 2: Tapping into the Wire... Brief Contents Acknowledgments... xv Introduction...xvii Chapter 1: Packet Analysis and Network Basics... 1 Chapter 2: Tapping into the Wire... 17 Chapter 3: Introduction to Wireshark... 37 Chapter 4:

More information

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol Transport Layer Transport Layer The transport layer is responsible for the delivery of a message from one process to another Types of Data Deliveries Client/Server Paradigm An application program on the

More information

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

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer CCNA R&S: Introduction to Networks Chapter 7: The Transport Layer Frank Schneemann 7.0.1.1 Introduction 7.0.1.2 Class Activity - We Need to Talk Game 7.1.1.1 Role of the Transport Layer The primary responsibilities

More information

Introduction to Computer Systems. Networks 2. c Theodore Norvell. The Sockets API

Introduction to Computer Systems. Networks 2. c Theodore Norvell. The Sockets API The Sockets API [Wait! If you are not familiar with file descriptors and the UNIX read and write system calls, read chapter 10 of Bryant and O Hallaron and/or my summary before going on.] In this section

More information

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

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1 Interconnecting Networks with TCP/IP 2000, Cisco Systems, Inc. 8-1 Objectives Upon completion of this chapter you will be able to perform the following tasks: Identify the IP protocol stack, its protocol

More information

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

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided. 223 Chapter 19 Inter mediate TCP The Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols was developed as part of the research that the Defense Advanced Research Projects Agency

More information

Interprocess Communication. Interprocess Communication

Interprocess Communication. Interprocess Communication Interprocess Communication Interprocess Communication The original UNIX systems had pipes as the only interprocess communication method. An improved interprocess communications interface was designed for

More information

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements Announcements CS 5565 Network Architecture and Protocols Lecture 5 Godmar Back Problem Set 1 due Feb 17 Project 1 handed out shortly 2 Layer The Layer Let s look at some s (in keeping with top-down) architectures:

More information

Networking Topics. Andi Kleen SuSE Labs

Networking Topics. Andi Kleen SuSE Labs Networking Topics Andi Kleen SuSE Labs " Non blocking Sockets " Unix Sockets " Netlink " Error handling " Path MTU discovery " IPv6 sockets Contents Non blocking sockets " Allows well scaling servers without

More information

How do we troubleshoot this? How does Esmeralda know how to fix this?

How do we troubleshoot this? How does Esmeralda know how to fix this? How do we troubleshoot this? How does Esmeralda know how to fix this? 2 Goal Find bugs in networked applications Large complex unknown applications!!! Large complex unknown networks!!! Understandable output

More information

LINUX INTERNALS & NETWORKING Weekend Workshop

LINUX INTERNALS & NETWORKING Weekend Workshop Here to take you beyond LINUX INTERNALS & NETWORKING Weekend Workshop Linux Internals & Networking Weekend workshop Objectives: To get you started with writing system programs in Linux Build deeper view

More information

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

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2014 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Project #1 Starts in one week Is your Linux environment all ready? Bring your laptop Work time after quick

More information

ECE 435 Network Engineering Lecture 17

ECE 435 Network Engineering Lecture 17 ECE 435 Network Engineering Lecture 17 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 7 November 2016 Announcements HW#6 graded, HW#8 on Wednesday Plumbers wrapup Not much network

More information

Programming with TCP/IP. Ram Dantu

Programming with TCP/IP. Ram Dantu 1 Programming with TCP/IP Ram Dantu 2 Client Server Computing Although the Internet provides a basic communication service, the protocol software cannot initiate contact with, or accept contact from, a

More information

Objectives. Chapter 10. Upon completion you will be able to:

Objectives. Chapter 10. Upon completion you will be able to: Chapter 10 Figure 10.1 Position of IGMP in the network layer Objectives Upon completion you will be able to: Know the purpose of IGMP Know the types of IGMP messages Understand how a member joins a group

More information

Network Implementation

Network Implementation CS 256/456: Operating Systems Network Implementation John Criswell! University of Rochester 1 Networking Overview 2 Networking Layers Application Layer Format of Application Data Transport Layer Which

More information

Topics for this Week

Topics for this Week Topics for this Week Layered Network Architecture ISO/OSI Reference Model Internet Protocol Suite Overview Application Programming Interface BSD Socket API Readings Sections 1.1-1.5, 6.1.3 (socket programming),

More information

Chapter 19 Network Layer: Logical Addressing

Chapter 19 Network Layer: Logical Addressing Chapter 19 Network Layer: Logical Addressing 19.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 19.2 19-1 IPv4 ADDRESSES An IPv4 address is a 32-bit address

More information

Novell TCP IP for Networking Professionals.

Novell TCP IP for Networking Professionals. Novell 050-649 TCP IP for Networking Professionals http://killexams.com/exam-detail/050-649 I. RECV (Receive) J. RETR (Retrieve) Answer: Pending, Please email feedback to support@hotcerts.com QUESTION:

More information

Transport Layer. Chapter 3: Transport Layer

Transport Layer. Chapter 3: Transport Layer Transport Layer EECS 3214 Slides courtesy of J.F Kurose and K.W. Ross, All Rights Reserved 29-Jan-18 1-1 Chapter 3: Transport Layer our goals: understand principles behind layer services: multiplexing,

More information

CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid. Internet Protocol Suite

CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid. Internet Protocol Suite CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid College of Computing and Information Technology Arab bacademy for Science &T Technology and Maritime Transport Internet Protocol Suite IP Suite Dr.

More information

Interconnecting Networks with TCP/IP

Interconnecting Networks with TCP/IP Chapter 8 Interconnecting s with TCP/IP 1999, Cisco Systems, Inc. 8-1 Introduction to TCP/IP Internet TCP/IP Early protocol suite Universal 1999, Cisco Systems, Inc. www.cisco.com ICND 8-2 TCP/IP Protocol

More information

Chapter 9: UDP sockets & address conversion function

Chapter 9: UDP sockets & address conversion function Chapter 9: UDP sockets & address conversion function 9.1 Elementary UDP sockets:- Introduction to UDP sockets UDP is connectionless, unreliable, datagram protocol TCP is connection-oriented, reliable byte

More information

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

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1 Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 23-1 PROCESS-TO-PROCESS DELIVERY 23.2 The transport

More information

On Distributed Communications, Rand Report RM-3420-PR, Paul Baran, August 1964

On Distributed Communications, Rand Report RM-3420-PR, Paul Baran, August 1964 The requirements for a future all-digital-data distributed network which provides common user service for a wide range of users having different requirements is considered. The use of a standard format

More information

An SCTP-Protocol Data Unit with several chunks

An SCTP-Protocol Data Unit with several chunks SCTP for Beginners Section 2 SCTP Packets he protocol data units (PDU) of SCTP are called SCTP packets. If SCTP runs over IP (as described in RFC2960 ), an SCTP packet forms the payload of an IP packet.

More information

CONTENTS IN DETAIL ACKNOWLEDGMENTS INTRODUCTION 1 PACKET ANALYSIS AND NETWORK BASICS 1 2 TAPPING INTO THE WIRE 17 3 INTRODUCTION TO WIRESHARK 35

CONTENTS IN DETAIL ACKNOWLEDGMENTS INTRODUCTION 1 PACKET ANALYSIS AND NETWORK BASICS 1 2 TAPPING INTO THE WIRE 17 3 INTRODUCTION TO WIRESHARK 35 CONTENTS IN DETAIL ACKNOWLEDGMENTS xv INTRODUCTION xvii Why This Book?...xvii Concepts and Approach...xviii How to Use This Book... xix About the Sample Capture Files... xx The Rural Technology Fund...

More information

Additional Material. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science Information Network I/No.

Additional Material. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science Information Network I/No. Additional Material Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science 2010 Information Network I/No.4 1 ! Protocol Suites for the Internet! Widely used from LANs

More information

Sistemas Operativos /2016 Support Document N o 1. Files, Pipes, FIFOs, I/O Redirection, and Unix Sockets

Sistemas Operativos /2016 Support Document N o 1. Files, Pipes, FIFOs, I/O Redirection, and Unix Sockets Universidade de Coimbra Departamento de Engenharia Electrotécnica e de Computadores Sistemas Operativos - 2015/2016 Support Document N o 1 Files, Pipes, FIFOs, I/O Redirection, and Unix Sockets 1 Objectives

More information

Internet Control Message Protocol (ICMP)

Internet Control Message Protocol (ICMP) Internet Control Message Protocol (ICMP) 1 Overview The IP (Internet Protocol) relies on several other protocols to perform necessary control and routing functions: Control functions (ICMP) Multicast signaling

More information

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

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data ELEX 4550 : Wide Area Networks 2015 Winter Session UDP and TCP is lecture describes the two most common transport-layer protocols used by IP networks: the User Datagram Protocol (UDP) and the Transmission

More information

Different Layers Lecture 20

Different Layers Lecture 20 Different Layers Lecture 20 10/15/2003 Jian Ren 1 The Network Layer 10/15/2003 Jian Ren 2 Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every host,

More information

internet technologies and standards

internet technologies and standards Institute of Telecommunications Warsaw University of Technology 2017 internet technologies and standards Piotr Gajowniczek Andrzej Bąk Michał Jarociński Network Layer The majority of slides presented in

More information

Introduction to Internetworking

Introduction to Internetworking Introduction to Internetworking Introductory terms Communications Network Facility that provides data transfer services An internet Collection of communications networks interconnected by bridges and/or

More information