1.以太网
1.1 套接字:socket。通信过程中,套接字是成对出现的。
一个文件描述符指向一个套接字(该套接字内部由内核借助两个缓冲区实现)
1.2 网络字节序:
小端法:(pc本地存储)高位存高地址,低位存低地址
大端法:(网络存储 )高位存在低地址,低位存在高地址。
int socket(int domain, int type, int protocol);
socket() creates an endpoint for communication and returns a file de‐
scriptor that refers to that endpoint. The file descriptor returned
by a successful call will be the lowest-numbered file descriptor not
currently open for the process.
socket为通信创建一个终端而且根据终端返回一个文件描述符。成功调用返回的文件描述符将是进程当前未打开的编号最低的文件描述符。
domain: