TheHingineer

  • Computer Networks


  • CN Part-1

  • CN Part-2

  • CN Part-3

  • CN Part-4

  • CN Part-5

  •  Point-to-Point Protocol (PPP) in Computer Networks

     PPP kya hai? (What is Point-to-Point Protocol?)

    • Point-to-Point Protocol (PPP) ek standard Data Link Layer (Layer 2) protocol hai, jo direct physical connection ke through do devices ya nodes ke beech communication establish karta hai.

    • Yeh mainly point-to-point links par use hota hai, jaise do routers ke beech dedicated leased line, broadband DSL connections, ya computer aur ISP (Internet Service Provider) ke beech dial-up connection.

    • Point-to-point link ka aasan matlab yeh hai ki ek wire ya transmission line par sirf do devices connected hote hain (ek sender aur ek receiver). Beech mein koi teesra device us medium ko share nahi karta.

    • PPP ko IETF (Internet Engineering Task Force) ne design kiya tha taaki puraane protocol SLIP (Serial Line Internet Protocol) ki kamiyo ko door kiya ja sake.

    Agar aapne OSI Model padha hai, toh PPP Data Link Layer par kaam karta hai aur higher layers (jaise Network Layer ke IP packets) ko frames mein pack karke safely transfer karta hai.

     PPP ki Zaroorat Kyu Padi? (Why PPP was needed?)

    PPP se pehle point-to-point serial communication ke liye SLIP (Serial Line Internet Protocol) use hota tha. Lekin SLIP mein bohot saari limitations thi:

    • SLIP mein koi Error Detection nahi tha (agar bits corrupt ho jayein toh pata nahi chalta tha).

    • SLIP sirf IP protocol ko support karta tha (multi-protocol support nahi tha).

    • SLIP mein koi Authentication mechanism nahi tha (koi bhi connect kar sakta tha bina password verify kiye).

    • SLIP dynamic IP address allocate nahi kar sakta tha.

    In sabhi problems ko solve karne ke liye PPP (Point-to-Point Protocol) introduce kiya gaya, jo secure, reliable aur multi-protocol support provide karta hai.

     Features of Point-to-Point Protocol (PPP)

    -> Byte-Oriented Protocol: PPP data ko bits ke bajaye bytes (characters) ke form mein process aur frame karta hai.
    -> Multi-Protocol Support: Yeh ek hi link par multiple Network Layer protocols (IPv4, IPv6, IPX, AppleTalk) ko ek saath carry kar sakta hai.
    -> Built-in Authentication: Security ke liye do powerful authentication protocols provide karta hai: PAP (Password Authentication Protocol) aur CHAP (Challenge Handshake Authentication Protocol).
    -> Error Detection: Har frame mein CRC (Cyclic Redundancy Check) checksum hota hai jisse corrupted frames identify ho jaate hain.
    -> Dynamic IP Configuration: Link establish hote time devices ko automatic IP address assign karne ki suvidha deta hai.
    -> No Flow Control and No Retransmission: PPP frames ke liye flow control aur retransmission (error correction) provide nahi karta. Corrupted frame ko discard kar diya jaata hai aur retransmission ka kaam upper layer (Transport Layer ke TCP) par chhod diya jaata hai.

     Main Components of PPP

    Point-to-Point Protocol ke teen primary components hote hain:

    +-------------------------------------------------------------+
    |                  PPP Architecture Components                 |
    +-------------------------------------------------------------+
    | 1. Framing Method (HDLC-based Framing with Byte Stuffing)   |
    | 2. Link Control Protocol (LCP) - Manages Link Lifecycle     |
    | 3. Network Control Protocols (NCP) - Configures Layer 3     |
    +-------------------------------------------------------------+

    1. Framing Method

    PPP HDLC (High-Level Data Link Control) jaisa frame format use karta hai. Yeh frames ke start aur end ko pehchanne ke liye flag bytes aur data transparency ke liye Byte Stuffing ka use karta hai.

    2. Link Control Protocol (LCP)

    LCP ka kaam hai physical link ko establish karna, configure karna, test karna, aur end mein terminate karna. Yeh dono ends ke beech negotiation karta hai jaise maximum frame size (MTU), authentication method, aur compression settings.

    3. Network Control Protocols (NCP)

    Jab LCP link establish kar leta hai, tab NCP active hota hai. NCP ka kaam hai different Network Layer protocols (jaise IP, IPv6, Novell IPX) ke liye connection setup aur parameters configure karna. Example: IPv4 ke liye IPCP (Internet Protocol Control Protocol) use hota hai.

     PPP Frame Format

    PPP frame ka structure HDLC se bohot milta-julta hai, lekin isme kuch specific differences hote hain:

    |  Flag  | Address | Control |  Protocol  |        Payload (Data)        |   FCS   |  Flag  |
    | 1 Byte | 1 Byte  | 1 Byte  | 1-2 Bytes  |    Variable (Up to 1500 B)   | 2-4 B   | 1 Byte |
    |  0x7E  |  0xFF   |  0x03   | Packet ID  |   Network Layer Packet / Info|   CRC   |  0x7E  |
    Field Size Kaam aur Description
    Flag 1 Byte Frame ka start aur end batata hai. Iska fixed pattern hota hai: 01111110 (Hex: 0x7E).
    Address 1 Byte Hamesha 11111111 (Hex: 0xFF) hota hai, jo broadcast address hai. Point-to-point link mein sirf do hi devices hote hain, isliye individual device address ki zaroorat nahi hoti.
    Control 1 Byte Hamesha 00000011 (Hex: 0x03) hota hai, jo Unnumbered Information frame ko represent karta hai. Yeh batata hai ki sequence numbering ya flow control use nahi ho raha.
    Protocol 1 ya 2 Bytes Bataata hai ki Payload field mein kaunsa data ja raha hai (e.g., IPv4, IPv6, LCP, NCP, PAP, CHAP). Example: 0x0021 ka matlab IPv4 packet hota hai.
    Payload (Data) Variable Actual user data ya higher layer packet. Default Maximum Transmission Unit (MTU) 1500 bytes hoti hai.
    FCS (Frame Check Sequence) 2 ya 4 Bytes Error detection ke liye 16-bit ya 32-bit CRC (Cyclic Redundancy Check) calculate karke add kiya jaata hai.
    Flag 1 Byte Frame closing delimiter, value: 0x7E.

     Byte Stuffing in PPP (Data Transparency)

    Frame boundaries ko identify karne ke liye PPP start aur end mein Flag byte (0x7E) lagata hai. Lekin sochiye agar actual payload data ke andar hi 0x7E byte aa jaye toh kya hoga?

    Receiver use frame ka end samajh lega aur aage ka data chhoot jayega! Is problem ko prevent karne ke liye PPP Byte Stuffing (Character Stuffing) ka use karta hai:

    • PPP ek special Control Escape byte use karta hai jiski value hoti hai: 0x7D (binary: 01111101).

    • Jab bhi actual data mein 0x7E (flag) aata hai, sender use do bytes se replace kar deta hai: 0x7D followed by 0x5E (jo ki 0x7E XOR 0x20 hota hai).

    • Agar actual data mein pehle se hi Escape byte 0x7D aa jaye, toh sender use 0x7D followed by 0x5D (jo ki 0x7D XOR 0x20 hai) se replace karta hai.

    • Receiver jab bhi 0x7D dekhta hai, toh wo use discard karta hai aur agle byte ko restore kar leta hai. Is tarah receiver ko original data bilkul intact milta hai.

     Phases of PPP Connection (Lifecycle of a PPP Link)

    Jab do devices PPP ke through connect hote hain, toh communication 6 phases se hokar guzarta hai:

    [ Link Dead Phase ]
            |
            v  (Physical Carrier Detected)
    [ Establish Phase ]  <==== LCP Packets Exchange (Negotiate MTU, Auth type)
            |
            v  (Options Accepted)
    [ Authenticate Phase ] <== Optional (PAP or CHAP Verification)
            |
            v  (Authentication Successful)
    [ Network Phase ]    <==== NCP Packets Exchange (IPCP allocates IP)
            |
            v  (Network Layer Configured)
    [ Open Phase ]       <==== Actual User Data Transfer (IP packets)
            |
            v  (Connection Closed or Carrier Lost)
    [ Terminate Phase ]  <==== LCP Terminate Packets Exchange
            |
            v
    [ Link Dead Phase ]

    1. Dead Phase: Link abhi inactive hai. Jaise hi physical link detect hota hai (e.g. carrier signal aata hai), state Establish Phase mein chali jaati hai.
    2. Establish Phase: Dono devices LCP (Link Control Protocol) packets exchange karte hain. Frame size, compression, aur authentication type decide hota hai.
    3. Authenticate Phase: Yeh optional phase hai. Agar dono ends ne authentication agree kiya hai, toh PAP ya CHAP ke through username aur password verify kiya jaata hai.
    4. Network Phase: Authentication pass hone ke baad, NCP active hota hai aur IP configuration establish karta hai (e.g., dynamic IP address dena).
    5. Open Phase: Link fully ready hai. Dono devices aapas mein user data packets (web browsing, file transfer, etc.) exchange karte hain.
    6. Terminate Phase: Jab user disconnect karta hai ya link drop hota hai, LCP Terminate-Request bhejta hai aur connection safely close ho jaata hai.

     Authentication in PPP: PAP vs CHAP

    PPP security ke liye do tarah ke authentication protocols provide karta hai:

    Feature PAP (Password Authentication Protocol) CHAP (Challenge Handshake Authentication Protocol)
    Handshake Mechanism 2-Way Handshake 3-Way Handshake
    Password Security Password plaintext (unencrypted) mein network par travel karta hai. Password kabhi network par send nahi hota. MD5 Hash use hota hai.
    Attack Vulnerability Eavesdropping aur packet sniffing se password chori ho sakta hai. Replay attacks aur snooping se protected rehta hai.
    Periodic Checks Sirf connection start hone par ek baar check karta hai. Session chalte waqt beech-beech mein repeated challenge bhej kar verify karta rehta hai.
    Security Level Low Security High Security (Industry Recommended)

     Difference between HDLC and PPP

    College exams mein aksar HDLC aur PPP ke beech difference pucha jaata hai:

    Property HDLC PPP (Point-to-Point Protocol)
    Orientation Bit-oriented (Bit Stuffing use karta hai) Byte-oriented (Byte Stuffing use karta hai)
    Link Type Point-to-point aur Multipoint dono support karta hai Sirf Point-to-point links ke liye designed hai
    Authentication Koi built-in authentication support nahi hai Built-in PAP aur CHAP authentication support hai
    Multi-protocol Original ISO HDLC single protocol ke liye tha Multi-protocol capable hai (IP, IPX, AppleTalk)
    Flow & Error Control Flow control aur Retransmission support karta hai Sirf Error Detection (CRC) karta hai, flow control nahi deta

     Advantages of PPP

    -> Multi-Protocol Support: Alag-alag Network Layer protocols ko simultaneously handle karta hai.
    -> Strong Authentication: PAP aur CHAP ke zariye unauthorized access prevent karta hai.
    -> Automatic IP Configuration: NCP (IPCP) ke through automatic client IP negotiation support karta hai.
    -> Error Detection: CRC FCS field ke zariye har corrupted frame ko accurately detect kar leta hai.
    -> Interoperability: IETF open standard hone ke kaaran different vendors (Cisco, Juniper, etc.) ke hardware par smoothly kaam karta hai.

     Disadvantages of PPP

    -> No Flow Control: Flow control mechanism nahi hone ke kaaran high-speed data transmission mein buffer overflow ka risk rehta hai (jise TCP handle karta hai).
    -> No Retransmission / Error Correction: Corrupted frames ko directly drop kar diya jaata hai; unhe retransmit nahi karta.
    -> Point-to-Point Only: Broadcast ya multipoint networks (jaise Ethernet LAN) par directly work nahi kar sakta bina tunneling ke (e.g. PPPoE ki zaroorat padti hai).

     Summary Table: PPP at a Glance

    Feature Details
    Protocol Name Point-to-Point Protocol (PPP)
    OSI Layer Data Link Layer (Layer 2)
    Nature Byte-oriented (Character Stuffing)
    Key Components Framing, LCP (Link Control Protocol), NCP (Network Control Protocol)
    Authentication Protocols PAP (Password Authentication Protocol), CHAP (Challenge Handshake)
    Error Checking CRC (16-bit ya 32-bit Frame Check Sequence)
    Predecessor SLIP (Serial Line Internet Protocol)
    Scroll to Top