Archive | September, 2013

PPP

10 Sep

-> PPP is an acronym for Point to Point Protocol.
-> PPP is an extension to TCP/IP that adds two additional sets of functionality:
– it can transmit TCP/IP packets over a serial link
– it has login security
-> TCP/IP by itself cannot be transmitted over a serial link.
-> Telecommunications companies however offer serial communications links around the globe right now and have done so for many years. Because, in parallel communications have issues like crosstalk across wires especially as the wire length increases, Clock skew is also an issue with parallel communications which occurs  when data across the various wires does not arrive at the same time creating synchronization issues.

Serial_comm
-> To make TCP/IP work over these serial links, it was necessary to create a protocol that could transmit TCP/IP packets over serial lines.
The two protocols that do this are:
– SLIP (Serial Line Internet Protocol)
– PPP (Point to Point Protocol)
-> PPP is more feature rich.

Advantage of PPP over SLIP:
-> built-in authentication in PPP.
-> Built-in negotiation of link parameters.
-> PPP also handles higher speed links better than SLIP does. This is due to the error-checking capability within the protocol. SLIP does not check datagrams as they pass through the connection for errors.
-> PPP offers multi-network protocol support. SLIP can only be used with TCP/IP. PPP can use a different protocols through one session, such as TCP/IP, IPX, AppleTalk,  and DECNET. This enables to connect to multiple types of systems on the remote network. This is achievied by NCP. PPP allows the simultaneous use of multiple  Network layer protocols.

-> The Point-to-Point Protocol (PPP) provides a standard method for encapsulating and transporting multiple protocols between two peers, such as IP, in a
point-to-point link. Links can be established, using modem lines or dedicated synchronous or asynchronous links.
-> PPP is a data link protocol.
-> It has 3 main components:
1. Encapsulation
2. LCP: Link Control Protocol that is used to establish the link, negotiate the link level configuration parameters with the other end, detect a looped-back link and other common misconfiguration errors, and terminate the link when it is no longer needed. An authentication facility is also provided to verify the identity of its peer on the link.
3. NCP: Network Control Protocol, separate NCP is used to negotiate the configuration of each network layer protocol (such as IP) carried by PPP.
PPP_Arch
-> To establish communications over a point-to-point link, the originating PPP first sends LCP frames to configure and (optionally) test the data link. After the link has been established and optional facilities have been negotiated as needed by the LCP, the originating PPP sends NCP frames to choose and configure one or more network layer protocols. When each of the chosen network layer protocols has been configured, packets from each network layer protocol can be sent over the link. The link will remain configured for communications until explicit LCP or NCP frames close the link, or until some external event occurs (for example, an inactivity timer expires or a user intervenes).

 

NEGOTIATION:

Establishing a PPP Session with LCP
Overview:
1. Link establishment and configuration negotation:
-> Complete when the receiving router sends a configuration-acknowledgement frame back to the router that initiates the connectio.
2. Link quality determination:
-> Optional
-> LCP tests the link to determine whether the link quality is sufficient to bring up the Network layer
-> Delays transmission of Network layer data until this is complete.
3.Network layer protocol configuration negotiation:
-> After LCP finishes
-> The appropriate NCP can separately configure Network layer protocols, and bring them up and take them down at any time.
-> If the LCP closes the link, it tells the network layer protocols
> It uses Internet Protocol Control Protocol for IP layer3 protocol.
ncp-process
LCP Negotiation (to establish, configure, and test the data link connection):
-> Ideal case:
Peer1          Configure-Request  –>  Pear2
Peer1  <–  Configure-ack                   Pear2
Peer1  <–  Configure-Request          Pear2
Peer1          Configure-ack           –>  Pear2
-> If any mismatch occur, each time Peer 1 sends a new Configure-Request message, it changes the Identifier value in the LCP header so that Configure-Request messages can be matched with their responses.
Eg Packets (from Peer1 to Peer2 case):
1.    Peer 1 sends a Configure-Request message requesting option W, option X set to 100, option Y set to 0, and option Z. Options W and Z are flag options.
2.    Peer 2 does not understand option Z so it sends a Configure-Reject message containing option Z.
3.    Peer 1 sends a new Configure-Request message requesting option W, option X set to 100, and option Y set to 0.
4.    Peer 2 prefers that option X be set to 200 so it sends a Configure-Nack message containing option X and its preferred value.
5.    Peer 1 sends a new Configure-Request message requesting option W, option X set to 200, and option Y set to 0.
6.    Peer 2 sends a Configure-Ack message.
-> Same kind of negotiation will happen from Peer2 to configured to send data to Peer 1. Very often, the LCP packets for the two dialogs are intermixed during the connection process.

NCP Negotiation (for establishing and configuring different Network layer protocols):
-> Once the link and PPP parameters have been negotiated with LCP, the PPP peers then use a series of Network Control Protocols (NCPs) to negotiate the parameters of individual LAN protocols. Microsoft PPP supports the following NCPs:
– Internet Protocol Control Protocol (IPCP) to negotiate the use of IP.
– Internetwork Packet Exchange Control Protocol (IPXCP) to negotiate the use of IPX.
– AppleTalk Control Protocol (ATCP) to negotiate the use of AppleTalk.
– NetBIOS Frames Control Protocol (NBFCP) to negotiate the use of NetBEUI.
-> Ideal case:
Peer1       Configure-Request  –>  Pear2
Peer1  <–  Configure-ack           Pear2
Peer1  <–  Configure-Request       Pear2
Peer1       Configure-ack      –>  Pear2
-> If any mismatch occur, each time Peer 1 sends a new Configure-Request message, it changes the Identifier value in the NCP header so that Configure-Request messages can be matched with their responses. Like mentioned in LCP.

-> A link remains between peers until a physical error, timeout, or termination request by one router.
-> During link maintenance, LCP can use messages to provide feedback and test the link:
-> Code-reject and Protocol-reject
Frame types that provide feedback when one device receives an invalid frame dur to either an unrecognized LCP code or bad protocol identifier
-> Echo-request, echo-reply, and discard-request
Used to test the link.

 

PACKET FORMAT:

Flag:
-> 1 byte.
-> Indicates the beginning or end of a frame. The flag field consists of the binary sequence 01111110.

Address:
-> 1 byte.
-> In HDLC this is the address of the destination of the frame. But in PPP we are dealing with a direct link between two devices, so this field has no real meaning.
-> It contains the binary sequence 11111111, the standard broadcast address. PPP does not assign individual station addresses.
-> When compression is used, the address field is omitted.

Control:
-> 1 byte.
-> always 00000011
-> Calls for user data in an unsequenced frame.
-> This field is used in HDLC for various control purposes.

Protocol:
-> 2 byte
-> Identifies the protocol of the datagram encapsulated in the Information field of the frame.
-> It indicates the frame type.
-> The value 0x0021 in the Protocol field marks this as an IPv4 datagram

Information:
-> Variable. The default maximum length of the information field is 1,500 bytes.
-> Zero or more bytes of payload that contains either data or control information, depending on the frame type.
For regular PPP data frames, the network-layer datagram is encapsulated.
For control frames, the control information fields are placed here instead.
-> In some cases, additional dummy bytes may be added to pad out the size of the PPP frame

Frame check sequence (FCS):
-> checksum computed over the frame to provide basic protection against errors in transmission.
-> Normally 16 bits (2 bytes). By prior agreement, consenting PPP implementations can use a 32-bit (4-byte) FCS for improved error detection.
-> FCS is calculated over the Address, Control, Protocol, Information and Padding fields

Flag:
-> 1 byte.
-> Indicates the beginning or end of a frame. The flag field consists of the binary sequence 01111110.

LCP: Link Control Protocol

LCP uses the PPP Protocol field as 0xC0-21.

Information field is splited like below
Code:
-> 1 byte.
-> Identifying the type of LCP packet.

ID:

Length:
-> 2 byte
-> indicating the size of the LCP packet and LCP packet type–specific data.

Information for some LCP Packets: