Layer | Preamble | Start frame delimiter (SFD) | MAC destination | MAC source | 802.1Q tag (optional) | Ethertype (Ethernet II) or length (IEEE 802.3) | Payload | Frame check sequence (32-bit CRC) | Interpacket gap (IPG) | |
---|---|---|---|---|---|---|---|---|---|---|
Length (octets) | 7 | 1 | 6 | 6 | (4) | 2 | 42–1500 | 4 | 12 | |
Layer 2 Ethernet frame | (not part of the frame) | ← 64–1522 octets → | ||||||||
Layer 1 Ethernet packet & IPG | ← 72–1530 octets → | ← 12 octets → |
int socket(int domain, int type, int protocol)
os will create a socket and return a handle. bind(int sockfd, struct sockaddr * my_addr, int addrlen)
tells
the OS what address to use. int listen(int sockfd, int backlog)
notifies OS the willingess to accept incoming connections on this socket.
int accept()
blocks waiting for connections. Sets the address of the incoming connection.
socket()
then bind()
then listen()
then accept()
int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
. Now an exchange of send()
and recv()
calls to send data. Client can call close()
to end the socket.
Operation | Description |
---|---|
OPTIONS | Request information about available options |
GET | Retrieve document identified in URL |
HEAD | Retrieve metainformation about document identified in URL |
POST | Give information (e.g., annotation) to server |
PUT | Store document under specified URL |
DELETE | Delete specified URL |
TRACE | Loopback request message |
CONNECT | For use by proxies |