Internet and PPP

The datalink layer for the TCP/IP protocol stack is part of the ill-defined bottom "host to network" layer that also includes the physical layer. The current Internet standard for a data link protocol is PPP Point-to-Point Protocol.

PPP consists of LCP (link control protocol) for bringing lines up and down, negotiating features like compression, etc., and NCP (network control protocol) which allows for different sorts of network layers (and thus makes PPP capable of being used for more than just IP).

PPP also supports authentication and the dynamic assignment of a network layer address, as well as the option to provide reliable service via sequence numbering of frames. Reliability is made optional so that both clearn media and noisy media are supported.

PPP uses character stuffing to avoid problems with the flag showing up in the data field.

Dial-up scenario

  1. PC user initiates connection to ISP router, modems synhronize and negotiate, channel is established
  2. LCP packets are sent via PPP frames to router, negotiation of link parameters is done
  3. NCP packets are sent, dynamically assigned IP address is returned from router
  4. PC now a part of Internet, higher level Internet protocols will work (FTP, HTTP, TELNET, etc)
  5. User is done with connection
  6. NCP tears down the network connection, freeing the assigned IP address for re-use
  7. LCP tears down the data link connection
  8. Modem is told to hangup

PPP frame format

The PPP frame is character oriented (8 bytes per character).
 
flag address control protocol payload checksum flag
1 byte 1 1 1 or 2 variable 2 or 4 1
01111110 11111111 00000011 01111110
identifies the start of the frame; character stuffing used for this value in payload there are no addresses, always all 1s; assumed point-to-point this value indicates an unnumbered frame; sequence number could be used over noisy medium tells what the payload contains (LCP, NCP, IP, IPX, Appletalk, etc) negotiated max by LCP, usually 1500 bytes size is negotiated marks end of frame
LCP includes the ability to negotiate away some of the fields (like address and control) which aren't used in most cases. Authentication takes place and must be successful before the NCP even begins.

The strength of PPP is that it supports multiple network protocols, and can be used harmoniously with various physical medium, including PSTN/modems and SONET.