Let's look at other physical layer protocols.                 host -- modem -------------------------- modem -- host  A popular protocol for serial lines: SLIP (Serial Line Internet Protocol) The protocol: Example:

original packet:
     -----------------------------------------------
     |       | c0 |             |db |              |
     -----------------------------------------------

packet sent by slip:

     -------------------------------------------------------
     |     | db | dc |        |db | dd |              | c0 |
     -------------------------------------------------------

Disadvantages:

Advantage:
Quick and easy!


Another serial line protocol:

CSLIP (Compressed SLIP)



Another serial line protocol:

PPP (the Point-to-point protocol)

PPP has three components:

PPP frame:

bytes:      1     1       1          2      0-1500   2      1
        ___________________________________________________________
        | flag | addr | control | protocol | data | crc | flag     |
        | 7E   |  FF  |   03    |          |      |     | 7E       |
        ------------------------------------------------------------
 

Note: there is no length field. So, if 7E (i.e.,the end byte) appears in the data, it will be misinterpreted.

So....

The link control protocol of PPP: The network control protocol of PPP:

Let's look at Data-link layer functionality.

The most common error-detecting method:

The Polynomial Code
or Cyclic Redundanvy Code (CRC)

Here's how it works:

     9       8       7       6       5       4       3       2       1       0
1 * x + 1 * x + 0 * x + 1 * x + 0 * x + 1 * x + 1 * x + 0 * x + 1 * x + 1 * x
And that comes out to be:
Example:

Packet:       1 1 0 1 0 1 1 0 1 1

        4
G(X) = x + x + 1

So, Generator is: 1 0 0 1 1

Modified packet: 1 1 0 1 0 1 1 0 1 1 0 0 0 0 (the original packet plus 4 0's)

Now do the division:
 
            1 1 0 0 0 0 1 0 1 0
           _____________________________
1 0 0 1 1 ) 1 1 0 1 0 1 1 0 1 1 0 0 0 0
            1 0 0 1 1
            ---------
            0 1 0 0 1 1
              1 0 0 1 1
              ---------
              0 0 0 0 0 1
                0 0 0 0 0
                ---------
                0 0 0 0 1 0
                  0 0 0 0 0
                  ---------
                   0 0 0 1 0 1
                     0 0 0 0 0
                     ---------
                     0 0 1 0 1 1
                       0 0 0 0 0
                       ---------
                       0 1 0 1 1 0
                         1 0 0 1 1
                         ---------
                         0 0 1 0 1 0
                           0 0 0 0 0
                           ---------
                           0 1 0 1 0 0
                             1 0 0 1 1
                             ---------
                           0 0 1 1 1 0 <- This is the remainder!

So, subtract the remainder from the (x^r * M(X)):

            1 1 0 1 0 1 1 0 1 1 0 0 0 0
          -                     1 1 1 0
            ---------------------------
            1 1 0 1 0 1 1 0 1 1 1 1 1 0

And that's what you transmit! So you send "1 1 0 1 0 1 1 0 1 1 1 1 1 0" to the peer. Note that we send the original packet with 4 extra bits. The 4 extra bits is the checksum!

Now, let's call the thing we transmit "T(x)".

T(x) is evenly divisible by G(x).

So, when the receiver gets the bits, they divide it by G(x) (i.e., 10011), and the result should have no remainder! If the result has no remainder, the receiver says the packet passed the checksum! The receiver chops off the last 4 bits and send the packet up to the next layer.