notes blog about

Networking models

OSI layering provides for standard interfaces between layers and has these benefits:

OSI and TCP/IP models:

       OSI              TCP/IP             TCP/IP             Sample
                        original           updated            protocol
  +------------+     +------------+     +------------+     +----------------+ The "language" that
7 |Application |     |            |     |            |     |Telnet HTTP     | apps and servers use
  |------------+     |            |     |            |     |FTP SMTP        | to communicate.
6 |Presentation|     |Application | 5-7 |Application |     |POP3 VoIP       |
  |------------+     |            |     |            |     |SNMP DNS Halo 3 |
5 |Session     |     |            |     |            |     |arp traceroute  |
  |------------+- - -+------------+- - -+------------+- - -+----------------+ Data transmission
4 |Transport   |     |Transport   |  4  |Transport   |     |TCP UDP         | characteristics.
  |------------+- - -+------------+- - -+------------+- - -+----------------+ How to move packets
3 |Network     |     |Internetwork|  3  |Internetwork|     |IP ICMP         | from src to dst.
  |------------+- - -+------------+- - -+------------+- - -+----------------+
2 |Data link   |     |Network     |  2  |Data link   |     |Eth HDLC PPP ARP|  
  |------------+     |            |- - -|------------|- - -|----------------| How to send raw data
1 |Physical    |     |access      |  1  |Physical    |     |Eth RJ-45 V.35  | across a physical medium.
  +------------+     +------------+     +------------+     +----------------+

TCP error recovery service provided to HTTP:

TCP error recovery service provided to HTTP

TCP/IP network access layer encapsulation:

Using ethernet to forward an IP packet to the router

Encapsulation and data:

Perspectives on encapsulation and data

Binary math

Binary to hexadecimal conversion:

                 01101110   Binary (representation of) byte

                  +    +
                  |    |
                  v    v

  Higher order  0110  1110  Lower order
  nibble                    nibble
                  +    +
                  |    |
                  v    v

                  6    14   Decimal byte

                  +    +
                  |    |
                  v    v

                  6    E    Hexadecimal byte

LANs

Most common Ethernet types

Name Speed (Mbps) Alt. name Standard Cable (max)
Ethernet 10 10BASE-T IEEE 802.3 Copper (100m)
Fast ethernet 100 100BASE-TX IEEE 802.3u Copper (100m)
Gigabit ethernet 1000 1000BASE-LX, 1000BASE-SX IEEE 802.3z Fiber (550m, 5km)
Gigabit ethernet 1000 1000BASE-T IEEE 802.3ab Copper (100m)

CSMA/CD algorithm (required by hubs)

TIA standard Ethernet cabling pinouts

T568A vs. T568B

Half duplex vs. full duplex

Ethernet addressing terminology

LAN headers

      DIX
     +--------+-----------+------+------+----------+---+
     |Preamble|Destination|Source| Type |Data + pad|FCS|
Bytes|   8    |     6     |  6   |  2   | 46-1500  | 4 |
     +--------+-----------+------+------+----------+---+

      IEEE 802.3 (orig)
     +----+---+-----------+------+------+----------+---+
     |Pre.|SFD|Destination|Source|Length|Data + pad|FCS|
     | 7  | 1 |     6     |  6   |  2   | 46-1500  | 4 |
     +----+---+-----------+------+------+----------+---+

      IEEE 802.3 (rev. 1997)
     +----+---+-----------+------+------+----------+---+
     |Pre.|SFD|Destination|Source|Len./ |Data + pad|FCS|
     | 7  | 1 |     6     |  6   |type 2| 46-1500  | 4 |
     +----+---+-----------+------+------+----------+---+

WANs

Point-to-Point WANs - OSI L1

Leased line – a WAN circuit usually not owned by the data owner but by a telco (telecommunications company)

LEASED LINE COMPONENTS

                  |                                               |
                  |      T   E   L   C   O        N  E  T         |
                  |                                               |
                  |           CO                                  |
+-------+    +---+|      +----------+          +----------+       |+---+    +-------+
|Router1+----+CSU+-------+WAN switch+----------+WAN switch+--------+CSU+----+Router2|
+-------+    +---+|      +----------+          +----------+  ^    |+---+ ^  +-------+
    ^          ^  |                                          |    |      |
    |          |  |                                          |    |    Short cable
    +----------+  |                                          |    |    (max 15m)
    |             |                                          |    |
    |           Demarc                                       |  Demarc
    |                                                        |
   CPE                                                Long cable (KMs)

WAN connectors:

WAN connectors

Terminology

WAN links speeds

Point-to-Point WANs - OSI L2

Most popular protocols: HDLC, PPP

HDLC

HDLC framing

       Standard
      +----+-------+-------+--------+---+
      |Flag|Address|Control|  Data  |FCS|
Bytes | 1  |   1   |   1   |Variable| 2 |
      +----+-------+-------+--------+---+

       Cisco (PPP)
      +----+-------+-------+----+--------+---+
      |Flag|Address|Control|Type|  Data  |FCS|
      | 1  |   1   |   1   | 2  |Variable| 2 |
      +----+-------+-------+----+--------+---+

Point-to-point protocol

Packet switching

Frame relay

Typical FR network

IPv4 addressing and routing

Standard 20-byte IPv4 header:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|  IHL  |   DS Field    |        Packet Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Identification        |Flags|      Fragment Offset    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Time to Live |    Protocol   |         Header Checksum       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Source Address                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Destination Address                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

IP addressing

Router logic

  1. use FCS to check for errors, if error occurred discard the frame and repeat this step
  2. discard the data-link header and trailer, leaving the IP packet
  3. use destination IP address to look up the outgoing interface in routing table
  4. encapsulate IP packet inside a data-link header and trailer appropriate for outgoing interface and forward the frame

L3 utilities

DNS

  1. What is the foo’s IP address?
  2. Foo’s IP is 10.1.1.2

ARP

  1. Hey everybody, if you are 10.1.1.2 tell me your MAC address!
  2. I’m 10.1.1.2 and my MAC is 0200.2222.222

DHCP

  1. Client – DHCP discover message (LAN broadcast)
  2. Server – DHCP offer message (LAN broadcast)
  3. Client – DHCP request message (to server)
  4. Server – DHCP acknowledgement (to client)

Transmission Control protocol (TCP)

Connection-oriented protocol – requires an exchange of message (or preestablished correlation) before data transfer

Features:

TCP header format (fields):

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|          Source Port          |       Destination Port        |    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
|                        Sequence Number                        |    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
|                    Acknowledgment Number                      |    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  Required
|  Data |           |U|A|P|R|S|F|                               |    |
| Offset| Reserved  |R|C|S|S|Y|I|            Window             |    |
|       |           |G|K|H|T|N|N|                               |    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
|           Checksum            |         Urgent Pointer        |    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|                    Options                    |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             data                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Window field – maximum number of unacknowledged bytes

Multiplexing relies on sockets

TCP connection establishment (three-way handshake):

 +-------+             SEQ=200                 +------+
 |Web    |     SYN, DPORT=80, SPORT=1027       |Web   |
 |browser| ----------------------------------> |server|
 +-------+                                     +------+
                    SEQ=1450, ACK=201
              SYN, ACK, DPORT=1027, SPORT=80
           <----------------------------------

                  SEQ=201, ACK=1451
               ACK, DPORT=80, SPORT=1027
           ---------------------------------->

Maximum transmission unit (MTU) - size of the largest L3 packet that can sit inside a frame’s data field (it’s 1500 bytes for many L2 protocols, including Ethernet)

User Datagram Protocol (UDP)

Connectionless protocol – does not require an exchange of message (or preestablished correlation) before data transfer

UDP adds just two features to IP:

apps using UDP are tolerant of the data loss or have some application mechanism for lost data recovery

UDP header format:

 0      7 8     15 16    23 24    31
+--------+--------+--------+--------+
|     Source      |   Destination   |
|      Port       |      Port       |
+--------+--------+--------+--------+
|                 |                 |
|     Length      |    Checksum     |
+--------+--------+--------+--------+
|
|          data octets ...
+---------------- ...

TCP/IP applications

QoS – application’s requirements from the network service

Before mid 1990s video and voice used totally separate networking facilities, today - VoIP.

VoIP QoS demands

HTTP commands and responses

See HTTP protocol for more.


Sources