Lemur zaprasza
TCP/IP Tutorial and Technical Overview RARP
In this section we will introduce the concepts of port and
Each process that wants to communicate with
As some higher-level programs are themselves protocols, standardized in the
The "well-known" ports are controlled and assigned by the Internet Assigned
Confusion due to two different applications trying to use the same port
UDP, TCP and ISO TP-4 all use the same "port principle". (Please see
Let us first consider the following terminologies:
lA socket is a special type of file handle which is used by a process to request network services from the operating system. lA socket address is the triple: {protocol, local-address, local-process}
In the TCP/IP suite, for example:
{tcp, 193.44.234.3, 12345}
{protocol, local-address, local-process, foreign-address,
In the TCP/IP suite, for example:
{tcp, 193.44.234.3, 1500, 193.44.234.5, 21}
could be a valid association.
{protocol, local-address, local-process}
or
{protocol, foreign-address, foreign-process}
which specify each half of a connection.
The socket interface is one of several application
4.2BSD allowed two different communication domains: Internet and UNIX.
The following lists some basic socket interface calls. In the next section
lInitialize a socket FORMAT: int sockfd = socket(int family, int
where:
lfamily stands for addressing family. It can take on values such as AF_UNIX, AF_INET, AF_NS and AF_IUCV. Its purpose is to specify the method of addressing used by the socket. ltype stands for the type of socket interface to be used. It can take on values such as SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, and SOCK_SEQPACKET. lprotocol can be UDP, TCP, IP or ICMP. lsockfd is an integer (similar to a file descriptor) returned by the socket call. lBind (Register) a socket to a port address FORMAT: int bind(int sockfd, struct sockaddr
where:
lsockfd is the same integer returned by the socket call. llocaladdr is the local address returned by the bind call. Note that after the bind call, we now have values for the first three parameters inside our 5-tuple association: {protocol, local-address, local-process, foreign-address,
FORMAT: int listen(int sockfd, int queue-size)
where:
lsockfd is the same integer returned by the socket call. lqueue-size indicates the number of connection requests which can be queued by the system while the local process has not yet issued the accept call. lAccept a connection FORMAT: int accept(int sockfd, struct sockaddr
where:
lsockfd is the same integer returned by the socket call. lforeign-address is the address of the foreign (client) process returned by the accept call. Note that this accept call is issued by a server process rather than
FORMAT: int connect(int sockfd, struct sockaddr
where:
lsockfd is the same integer returned by the socket call. lforeign-address is the address of the foreign (server) process returned by the connect call. Note that this call is issued by a client process rather than a server
The read(), readv(sockfd, char *buffer, int
Note that these calls are similar to the standard read and
FORMAT: int close(int sockfd)
where:
lsockfd is the same integer returned by the socket call. For more details, please refer to [Stevens] and the product implementation
As an example, consider the socket system calls for a connection-oriented
Consider the previous socket system calls in terms of
The socket interface is differentiated by the different services that are
lStream socket interface (SOCK_STREAM): It defines a reliable connection-oriented service (over TCP for example). Data is sent without errors or duplication and is received in the same order as it is sent. Flow control is built-in to avoid data overruns. No boundaries are imposed on the exchanged data, which is considered to be a stream of bytes. An example of an application that uses stream sockets is the File Transfer Program (FTP). lDatagram socket interface (SOCK_DGRAM): It defines a connectionless service (over UDP for example). Datagrams are sent as independent packets. The service provides no guarantees; data can be lost or duplicated, and datagrams can arrive out of order. No disassembly and reassembly of packets is performed. An example of an application that uses datagram sockets is the Network File System (NFS). lRaw socket interface (SOCK_RAW): It allows direct access to lower-layer protocols such as IP and ICMP. This interface is often used for testing new protocol implementations. An example of an application that uses raw sockets is the Ping command. 2.10.5 Implementations In this section we discuss how sockets are implemented in the IBM TCP/IP
The socket implementation in TCP/IP for VM and MVS supports two addressing
In an MVS OpenEdition environment AF_UNIX sockets are also supported.
TCP/IP for OS/2 and TCP/IP for DOS both support the AF_INET
All AIX implementations support the AF_INET and AF_UNIX
They all support the 4.3BSD sockets and the datagram and stream socket
User
|