The transport provider is the entity that provides the services of the Transport Interface, and the transport user is the entity that requires these services. The objective of this presentation is to aware the students about the field of socket programming in UNIX. This presentation is useful for B.Tech(IT) 6th semester students as well as the students of networking and programming.
2. SOCKET TYPES
• There are three types of Sockets are:
1. Stream Socket
2. Datagram Socket
3. Raw Socket
• After understand the concept of socket and its types then
will be discussing the brief introduction TLI and Its uses.
3. STREAM SOCKET
• Has worked on Transport Layer and make end to end connection. This socket is a Connection-
oriented service which means that receiver give acknowledgment to the Sender.
• It is full duplex nature which can be transmitted in both directions.
• It is Reliable, which means that error-free data delivery is guaranteed in right order and
without duplication.
• It is Byte stream, no boundaries are imposed on the data. The data being transmitted can be of
virtually unlimited size.
• Flow control, which guarantees that the sender does not send data faster than the network and
the receiver is able to manage.
• The example of Stream Socket is TCP protocol which has used in TCP/IP Protocol Stack
4. DATAGRAM SOCKET
• Has worked on Transport Layer and make end to end connection. This socket is a
Connection-less service which means that receiver does not give acknowledgment
to the Sender.
• It does not provide Reliability, which means that that data may be duplicated, out
of order, corrupted or never sent.
• No flow control feature, this means user (receiver) has to manage the buffer.
• Messages have a maximum size. If you want to send more data than the amount
you can send in a single datagram, you must send more independent datagrams.
• The example of Datagram Socket is UDP protocol which has used in TCP/IP
Protocol Stack
5. RAW SOCKET
• This socket has used in Network Layer and support IP and ICMP protocols.
• It provides Connectionless service.
• It doesnot provide any Reliability.
• We send maximum data to remote network using Raw Socket.
• PING is an example of an application that uses raw sockets.
6. COMPARISON OF DIFFERENT SOCKET
TYPES
Feature
Stream Datagram Raw
Reliable Yes No No
Performance Connection oriented but
overhead there.
Good Best
Data Size Large amount of Data (1500
Bytes)
64 Bytes 65535
Protocol Used TCP UDP IP,ICMP
7. TRANSPORT INTERFACE
• The transport provider is the entity that provides the services of the Transport
Interface, and the transport user is the entity that requires these services
• The transport user accesses the services of the transport provider by issuing the
appropriate service requests. One example is a request to transfer data over a
connection. Similarly, the transport provider notifies the user of various events,
such as the arrival of data on a connection.
• The Network Services Library includes a set of functions that support the services
of the Transport Interface for user processes.
8. OVERVIEW OF TLI OR TRANSPORT
LAYER INTERFACE
• TLI or Transport Layer Interface provides an interface to the networking system.
• TLI is media- and protocol-independent
• An Alternative to the socket interface which is defined for System V UNIX
System.
• Transport Layer Interface work like any networking protocol and also supported
kernel.
• It is a subset of the X/Open Transport Interface (XTI), and is implemented within
the STREAMS framework.
• It allows applications to run across any transport protocol that supports the
interface.
9. TLI FUNCTION
• TLI is an interface (set of functions) that hides the actual stream interface to the
networking system from the user.
• TLI functions support both connection-oriented (TCP) and connectionless
protocols (UDP).
10. FUNCTIONS OF TLI
We are using three types of functions:
• M_DATA: User data processed through I/O
• M_PROTO: This is a protocol control information that have used to apply on
every layer of TCP/IP protocol. This is basically used to control the bits stream
and provide layer interface.
• M_PCPPROTO: This function is used to figure-out the higher priority protocols.
This is also used for prioritize the messages which means higher priority messages
(like remote messages, TELNET,SSH) always to send first than lower priority
messages (like ordinary messages).
11. ROLES OF TLI
• Another role TLI is used select the network and mapping of network Name to
address (it converts network naming to address conversion like DNS).
Role of Function Description
getnetpath() It describes the routines that manipulate the NETPATH variable,
allowing you to specify which networks in the netconfig file to try.
netconfig() It describes the network configuration database file.
netdir() describes the Name-to-Address Mapping library functions.
12. TLI ROUTINES
Routines Description
t_alloc() Allocates Transport Interface data structures
t_error() Prints a Transport Interface error message
t_getstate() Returns the state of a transport endpoint
t_open() Establishes a transport endpoint connected to a chosen transport provider
t_optmgmt() Negotiates protocol-specific options with the transport provider
t_sync() Synchronizes a transport endpoint with the transport provider
t_unbind() Unbinds a transport address from a transport endpoint
t_bind() Binds a transport address to a transport endpoint
t_close() Closes a transport endpoint
13. TLI SERVICES
The three service types defined by the Transport Interface are as follows:
• T_COTS: The transport provider supports connection-mode service but does not
provide the optional orderly release facility.
• T_COTS_ORD: The transport provider supports connection-mode service with
the optional orderly release facility.
• T_CLTS: The transport provider supports connectionless-mode service. Only one
such service can be associated with the transport provider identified by t_open().
14. REFERENCES
[1] W. R. Stevens, B. Fenner & A. M. Rudoff, Unix Network Programming, Vol. I, 3rd Ed., Pearson
Education.
[2] W. R. Stevens , Unix Network Programming, Vol. II, 2nd Ed., Pearson Education.
[3] Comer and Stevens, Internetworking with TCP/IP, Vol. I, II and III, PHI.
[4] Christian Benvenuti, Understanding Linux Network Internals, O‘Reilly.
[5] W. R. Stevens , Advanced Programming in Unix Environment, Pearson Education.
[6]Brian “Beej” Hall,"Beej’s Guide to Network Programming Using Internet Sockets",2005.
[7] Xi Liu,"Socket Programming",Computer Networks, Spring 2008.
[8] Dave Hollinger,Socket Programming",Computer Network Systems.
[9] http://retrogeeks.org/sgi_bookshelves/SGI_Developer/books/IRIX_NetPG/sgi_html/ch09.html