Appendix A
Packet Formats and Constants

File: nsl/packets.tex, r1669

A.1 Packet Formats


PIC

Figure A.1: IP Datagram Format


PIC

Figure A.2: TCP Segment Format


PIC

Figure A.3: UDP Datagram Format


PIC

Figure A.4: Ethernet Frame Format

A.2 Port Numbers and Status Codes

IANA and W3C maintain the official list of port numbers, protocol numbers and HTTP status codes.

Port numbers used by common applications include:

20
FTP data transfer
21
FTP connection control
22
SSH, secure remote login
23
TELNET, (unsecure) remote login
25
SMTP, email transfer between servers
53
DNS, domain name lookups
67
DHCP server
68
DHCP client
80
HTTP, web servers
110
POP3, client access to email
123
NTP, network time
443
HTTPS, web servers with secure access
520
RIP, routing protocol
631
IPP, Internet printing
1503
Windows Live Messenger
1512
WINS, Windows naming service
3306
MySQL database server
3723
Blizzard games
5060
SIP, voice/video signalling
5190
ICQ, instant messaging
8080
HTTP proxy server

Protocol numbers for commonly used transport protocols include:

1
ICMP
2
IGMP
6
TCP
17
UDP
33
DCCP
41
IPv6 encapsulation
47
GRE
89
OSPF

Status codes and their meaning for common HTTP responses include:

100 Continue
Client should continue to sent the request
200 Ok
Requested content is included in response
301 Moved Permanently
This and all future requests should be redirected to the given URL
304 Not Modified
Requested content has not been modified since last access
401 Unauthorized
Requested content requires authentication that has not been provided or is incorrect
403 Forbidden
Request is ok, but not allowed to access the requested content
404 Not Found
Requested content could not be found on server
503 Service Unavailable
Requested server is currently unavailable