Socket options: a summary –Tcp options, ip options and general socket options can be examined and sometimes modified. getsockopt, setsockopt routines Some.

Slides:



Advertisements
Similar presentations
Multicasting© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science.
Advertisements

Socket Options. abstraction Introduction getsockopt and setsockopt function socket state Generic socket option IPv4 socket option ICMPv6 socket option.
Guide to TCP/IP, Third Edition
Netprog Advanced Sockets Programming1 Advanced Sockets Programming Ref: Chapter 7,11,21,22.
I/O Models Satish Krishnan. I/O Models Blocking I/O Non-blocking I/O I/O Multiplexing Signal driven I/O Asynchronous I/O.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Multicasting - Part II© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Sockets CS 3516 – Computer Networks. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Distributed Computing Systems Sockets. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Elementary TCP Sockets Computer Networks Computer Networks Term B10 UNIX Network Programming Vol. 1, Second Ed. Stevens Chapter 4.
Lecture 19 Advanced Sockets Programming CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
MULTICAST USING UDP SOCKETS. PRELIMINARIES *CAST Unicast Communication is strictly from one sender to another specified receiver eg: TCP on LAN Broadcast.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Computer Networks Sockets.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Multimedia Networking Sockets. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
TDC561 Network Programming Camelia Zlatea, PhD Week 8: Multicasting; Socket Options;
Sockets IMGD Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Multicasting Jari Kellokoski Introduction When a unicast address identifies a sigle IP interface Then a broadcast address identifies all IP.
Socket Options Jari Kellokoski. Introduction So far we have discovered some basic usage of socket With socket options we control sockets more suitable.
1 I/O Multiplexing Computer Network Programming. 2 Input from multiple sources Process keyboard sockets file A process may have multiple sources of input.
Computer Networks Sockets. Outline F Socket basics F Socket details.
Computer Network Architecture and Programming
1 Application Presentation Session Transport Network Datalink Physical OSI model Application IPv4, IPv6 Device Driver Hardware TCPUDP Internet.
Operating Systems Sockets. Outline F Socket basics F TCP sockets F Socket details F Socket options F Final notes F Project 3.
Socket options A way for network applications to ‘tweak’ the processing done at lower-levels of the TCP/IP stack.
Socket option Getsockopt ou setsockopt fcntl ioctl.
Broadcast and Multicast. Unicast Host 2Host 1 Broadcast Packet received by every host on network (including the sender!)
1 Introduction to Raw Sockets 2 IP address Port address MAC address TCP/IP Stack 67 Bootp DHCP OSPF protocol frame type UDP Port # TCP Port.
ECE 4110 – Internetwork Programming Client-Server Model.
Assignment 3 A Client/Server Application: Chatroom.
IT1352-NETWORK PROGRAMMING AND MANAGEMENT
TCP Timers Chia-tai Tsai Introduction The 7 Timers for each Connection Connection-Establishment Timer Establish a new connection.
1 CMPT 471 Networking II Transport Layer Network Programming © Janice Regan, 2013.
More on Socket API. How to Place Timeouts on Sockets (1)  Using SIGALRM signal Connection timeout 기간의 축소 Response timeout advio/dgclitimeo3.clib/connect_timeo.c.
Review: How to create a TCP end point? What is the right format for sin_port and sin_addr in the sockaddr_in data structure? How many different ways we.
Chaptere19 multicasting. contents multicast address multicasting versus broadcasting on a LAN multicasting on a WAN multicast socket option mcast_join.
More on Socket API. More on Socket I/O Functions  Scatter read and gather write.
Netprog: Advanced Sockets Programming1 Advanced Sockets Programming Ref: Chapter 7,11,21,22.
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
1 Socket Options Ref: Chapter 7. 2 Socket Options Various attributes that are used to determine the behavior of sockets.Various attributes that are used.
Today’s topic –Broadcast and multicast –Send/receive broadcast and multicast packets.
I/O Multiplexing. What is I/O multiplexing? When an application needs to handle multiple I/O descriptors at the same time –E.g. file and socket descriptors,
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.
Today’s topic: UDP Reliable communication over UDP.
TELE 402 Lecture 8: Broadcast and Multicast 1 Overview Last Lecture –IPv6 This Lecture –Broadcast and multicast sockets –Source: Chapters 20&21 of Stevens’
Review: –Concurrent server and multiplexed server How they work? Which one is better?
1 Socket Options getsockopt and setsockopt functions Check options and obtain default values Generic socket options IPv4 socket options IPv6 socket options.
CMPT 471 Networking II Network Programming © Janice Regan,
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
IP Configuration API. Network Interface Configuration NAIfconfigIsDeviceUp() NAIfconfigDeviceFromInterface() NAIfconfigBringDeviceUp() NAIfconfigSetIpAddress()
Computer Networking Project II question/answer session October 18, 2001.
UDP : User Datagram Protocol 백 일 우
Broadcasting and Multicasting –An area that is not well standardized – systems from different vendors may behave differently when dealing with broadcast.
Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki CS 547/490 Network.
Client/Server Design Issues Based on Java Network Programming and Distributed Computing, Chapter 6 Also Online Java Tutorial, Sun.
Sockets API Developing Applications using the Sockets API.
Lecture Class 3 Advanced Socket Programming: Broadcast & Multicast Concepts.
IPv4 socket option Level => IPPROTO_IP
Socket Option.
Operating Systems Sockets ENCE 360.
Week 13 - Friday CS222.
CHAPTER 8 ELEMENTARY UDP SOCKETS
Multicast architecture in Linux
學研計畫Training Course IP Multicasting
Chapter 07. Socket Options.
Advanced Sockets Programming
Advanced I/O Functions
Socket options: a summary
Advanced UNIX programming
Presentation transcript:

Socket options: a summary –Tcp options, ip options and general socket options can be examined and sometimes modified. getsockopt, setsockopt routines Some examples: –Socket (TCP/UDP) send/receive buffer size –Socket (TCP/UDP) send/receive low/high watermark –UDP broadcasting –TCP keep alive timer –IP options: e.g. source routing »IP Time to live (TTL) »IP quality of service (TOS) –IP multicast options

–#include int getsockopt (int sockfd, int level, int optname, void *optval, socklen_t *optlen); Int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); Level includes general socket option (SOL_SOCKET) and protocol-specific option (IP, TCP, etc). Option value can be of different types : int, in_addr, timeval, … ---- that is why we use the void pointer.

General socket options (level = SOL_SOCKET) –Optnames: SO_BROADCAST(int): permit sending broadcast datagram SO_DEBUG: for debugging purpose SO_DONROUTE: used by routing daemon to make sure a packet goes through a certain interface. SO_ERROR: can only be got (not set), reset the error SO_KEEPALIVE: for TCP only, automatic send keepalive message when inactive for 2 hours (can be modified). SO_LINGER: for TCP only, determines the behavior when a close is called. SO_OOBINLINE: put out of band data in the normal input queue. SO_RCVBUF, SO_SNDBUF: send and receive buffer size.

General socket options (level = SOL_SOCKET) –Optnames: SO_RCVLOWAT, SO_SENDLOWAT: low watermark – affect the select system call SO_RCVTIMEO, SO_SNDTIMEO: inherent timeout time (disable by default) SO_REUSEADDR: Allows the port to be reused – all server should do this to restart immediately SO_TYPE: socket type? SOCK_STREAM and SOCK_DGRAM. SO_USELOOPBACK: sending socket gets a copy?

IP options: –Allows packets sent through a socket to have certain behavior, e.g source routing –Level = IPPROTO_IP Example optnames: (manipulating IP header fields) –IP_HDRINCL: who builds the IP header (raw socket). –IP_OPTIONS: setting IP optional header fields –IP_TOS –IP_TTL

IP options: –Level = IPPROTO_IP Optnames: (IP MULTICAST related) –IP_MULTICAST_IF –IP_MULTICAST_TTL –IP_MULTICAST_LOOP –IP_ADD_MEMBERSHIP –IP_DROP_MEMBERSHIP

TCP options: –Level = IPPROTO_TCP Optnames: –TCP_KEEPALIVE: set the time –TCP_MAXRT: maximum retransmission time –TCP_MAXSEG: maximum segment size –TCP_NODELAY: wait to ack or not (enable) –See example5.c