OSD Home

Physical layers

Ethernet

Ethernet is also known as Carrier Sense, Multiple Access with Collision Detection (CSMA/CD). This describes the operation of Ethernet, in which a host waits until the transmission medium is quiet (carrier sense), begins transmitting a carrier, then transmits the packet. The host monitors its own transmission to detect if it becomes garbled because another host began transmitting at the exact same instant (collision detection). Collisions cause both hosts to stop transmitting, wait a random interval, then try again. Ethernet is probabilistic: there is no guarantee that the packet will be delivered. The collision rate skyrockets when the network is heavily loaded. Under normal circumstances, however, there are few collisions, and Ethernet is reliable and gives good performance.

'Multiple access' means that all Ethernet hosts are equals (peers). There are no masters or slaves, or hosts with different priorities or privileges.

A single Ethernet frame has a 14-byte header, 46 to 1500 bytes of data, and a 4-byte checksum, for a total frame size of 64-1518 bytes. If the data to be transmitted is shorter than 46 bytes, zero bytes must be added before the checksum as padding. The header is specified by IEEE standard 802.3:

Multi-byte values in the Ethernet frame are big endian (network byte order).

Each Ethernet device has a unique address. Blocks of addresses are assigned by a central authority (the IEEE) to manufacturers, who then assign unique addresses from the blocks to each device they manufacture. The top 24 bits of the address indicate the vendor. From RFC-1700:
Top 24 bits of Ethernet address Vendor
00000C Cisco
0000BC Allen-Bradley
00AA00 Intel
02608C 3Com
080009 Hewlett-Packard
080020 Sun

Ethernet supports broadcast packets, which will be received by all hosts. Such a packet has the destination address set to all ones (FF:FF:FF:FF:FF:FF).

SLIP

SLIP stands for Serial Line IP. It's an extremely simple standard for sending IP packets over a serial connection. SLIP is described in RFC-1055, which is a 12K text document.

Transport protocols

IP

IP stands for Internetwork Protocol. All IP hosts are equals (peers). There are no masters or slaves, or hosts with different priorities or privileges.

An IP packet (or datagram) is a minimum of 20 bytes long, which is the minimum size of the IP header. All multi-byte values in the packet are big endian (network byte order).
xxx - packet details

IP addresses are 32 bits (for IP v4). Blocks of addresses on the Internet are assigned by a central authority (IANA). These blocks may contain 16 million addresses (Class A), 65,000 addresses (Class B), or 256 addresses (Class C). Because of concern over the depletion of the IPv4 address space, blocks of intermediate sizes are also being used.

Unlike Ethernet, individual IP v4 addresses may be assigned dyanmically, to different hosts at different times.

xxx - lots more details...

IPX

xxx - to do
Obsolete? New NetWare uses IP as the default...

AppleTalk

xxx - to do

Code snippets

These snippets can be built with GCC for Linux, MinGW (GCC for Windows), Borland C 5.5 for Windows, Turbo C for DOS, or 16-bit Watcom C for DOS.

Links

TCP/IP and related network protocols are specified by the RFCs (Requests For Comment):
http://www.rfc-editor.org. Some of the more basic RFCs are:
RFC-791 IP (Internetwork Protocol, version 4)
RFC-792 ICMP (Internetwork Control Message Protocol)
RFC-826 ARP (Address Resolution Protocol; for IP over Ethernet)
RFC-786 UDP (User Datagram Protocol)
RFC-1025 TCP/IP Bake-Off (testing of TCP/IP implementations)
RFC-1122 Requirements for Internet hosts (1)
RFC-1123 Requirements for Internet hosts (2)
RFC-1700 Assigned Numbers

Roll Your Own Intranet: http://www.vijaymukhi.com/vmis/roll.htm (write your own TCP/IP stack)

Ethernet Encapsulation Cheat Sheet: http://www.cisco.com/warp/public/105/encheat.html

Small TCP/IP stacks:

Asm source code for 16-bit packet drivers: ftp://ftp.crynwr.com/drivers/00index.html

Spec sheet for National Semiconductor 8390 chip, used in NE2000 Ethernet board: http://www.national.com/pf/DP/DP8390D.html

TO DO

- only Ethernet II is described here. Other types of Ethernet:
  'raw' 802.3 (Ether type = packet length), 802.2 LLC, 802.2 LLC + SNAP
  (are these three obsolete?)
- Service Access Point (SAP) codes for 802.2 LLC
- IEEE 802.5 (Token Ring)?
- details of IP packet: version, IHL, TOS, packet length, ID, flags,
  fragment offset, TTL, protocol, header checksum, src and dst adr
- Other IP stuff: addressing, subnets, fragmentation, MaxTU, broadcasts
- protocols that run atop IP: ICMP, UDP, TCP
- protocols that run atop UDP: BOOTP, DHCP, TFTP, DNS
- protocols that run atop TCP: HTTP, FTP, SMTP, POP, NNTP, FTP, Telnet
- Berkeley socket API
- IPX? AppleTalk? IP v6?
- ARP

REPORT BUGS OR ERRORS IN THIS DOCUMENT