外文翻译-----TCPip在linux下的具体实现.doc
文本预览下载声明
TCP / IP in Linux implementation
1common TCP / IP logic structure;
And ISO proposed OSI network layer (layer 7), TCP / IP defines five layer.
Function of each layer and the corresponding hardware:
Physical layer: defines the transport level and hardware interface standard..
Data link layer: corresponding to the card ( in this layer to call the specific read / write functions to the package through the card out )
Network layer: used for routing, put in charge of a packet sent to the specified network machine;
Transport layer: the received packet is transmitted from the specific processes ( according to the port number );
Application layer: the useful data for reassembly, defining a transmission port and so on;
2 TCP / IP protocol stack in Linux level
LINUX under the TCP / IP protocol stack is 4.4BSD as template, estimated to be present in most operating system is used as a template, support for BSD Socket programming, that is commonly used in network programming model;
On the server side:
1call socket ( ) to create a socket;
Bind (2)
Listen (3)
Accept (4);
5( read / write )
On the client side
Socket (1);
Connect (2);
3( read / write );
2.2 with the realization of TCP / IP about the basic knowledge of linux:
In Linux, all the equipment as file node to management, network equipment is not exceptional also, i.e., to a process in the socket to read and write is equivalent to the process in the open file to read and write, concretely embodied in the different reading and writing functions of different;
Can generally have a look process, file system and the relationship between socket;
Process data structure: / / concerned only with documents related to the part
Struct task_struct.
... . / / omit most of the content.
/ * filesystem Information * / / / process with related documents;
Struct fs_struct * fs;
/ * open file information * /
Struct files_struct * files;
};
Omit a lot of structure, with the file on the fs_struct * FS and files_struct * files two structure; the for
显示全部