Intro to Computer Networking

Protocols: A defined set of standards that computers must follow in order to communicate properly

Computer networking: The name we've given to the full scope of how computers communicate with each other. They speak protocols so that they understand each other and they repeat messages not fully delivered.

Computer networking is a layered affair. Protocols at each layer carry the ones above them in order to get from one place to next.

The TCP/IP Five-Layered Network Model

TCP/IP

1. Physical layer: Represents the physical devices that interconnect computers. Things such as cables, connectors, specifications how signals are sent over the wire.

2. Data Link Layer (Network Interface (or Access) Layer): Responsible for defining a common way of interpreting these signals so network devices can communicate.

  • Protocols used on this layer:

    • Ethernet (IEEE 802.2): The Ethernet standards define a protocol responsible for getting data to nodes on the same network or link. Ethernet uses MAC addresses.

    • Point-to-Point Protocol (PPP)

The data link layer has two sublayers:

  • Logical Link Control (LLC)

  • Media Access Control

    • Determines who is allowed to access the media at any one time (e.g. CSMA/CD). It works based on MAC addresses.

3. Network Layer (Internet Layer): Allows different networks to communicate with each other through devices known as routers.

  • Internetwork: A collection of networks connected together through routers, the most famous of these being the Internet.

  • The Protocol used on this network is:

    • Internet Protocol (IP): IP is the heart of the internet and most smaller networks around the world.

4. Transport Layer: Sorts out which client and server programs are supposed to get that data

  • The Protocol used on this layer are:

    • TCP (Transmission Control Protocol):

    • UDP (User Datagram Protocol):

  • IP is responsible for getting from one node to another.

  • Remember that the Transport layer is responsible for ensuring that the data gets to the right application running on those nodes.

5. Application Layer: Lots of protocols running at this layer, and applications are protocol specific.

OSI Model:

The seven OSI layers are defines as follows:

  1. Application: Provides different services to the application

  2. Presentation: Converts the information

  3. Session: Handles problems which are not communication issues

  4. Transport: Provides end to end communication control

  5. Network: Routes the information in the network

  6. Data Link: Provides error control

  7. Physical: Connects the entity to the transmission media

Cables

  • Copper cables

    • Made up of multiple pairs of copper wires inside plastic insulators

    • Interpret signals by changing voltage 1, 0

    • Twisted-pair cables:

      • Cat5, Cat5e, Cat6

      • Cat5 is older and replaced by Cat5e and Cat6

      • Cat5 had crosstalk issues: when an electrical pulse on one wire is accidentally on another wire.

  • Fiber cables

    • Contain individual optical fibers, which are tiny tubes made out of glass about the width of a human hair.

    • These tubes of glass can transport beams of light. It uses pulses of lights

    • Sometimes used in an environment where there is a lot of electromagnetic interference from outside sources

Hubs and Switches and Routers

Network devices:

Cables allow you to form point-to-point networking connections.

Hub: A physical layer device that allows for connections from many computers at once.

  • All the devices connected to the hub end up talking to all other devices at the same time. It is up to the connected devices to determine if the incoming data is meant for them or to ignore it if it isn't.

  • Collision domain: A network segment where only one device can communicate at a time

Switch: A layer two (data link) device, more intelligent than a hub.

  • A switch can inspect the content of the ethernet protocol data being sent around the network determine which system the data is intended to and delivers the data only to that system using a MAC table.

  • Switch significantly reduces the size of collision domain. That means higher throughput.

Hubs and Switches: The primary devices used to connect computers on a single network, usually referred to as a LAN, or Local Area Network.

Router: A device that knows how to forward data between independent networks. A router operates at layer 3.

  • A router can determine IP data to where to send things (packets).

  • Routers maintain an internal table containing information on how to route traffic between lots of networks all over the world.

  • A SOHO router maintains a very small routing table. And, its main purpose is to forward traffic to the ISP.

  • Once the packet is at the ISP, a way more sophisticated router takes over and forwards the packet across the internet.

  • The ISP routers don't just handle more traffic but also much more complexity about making the decision where to send traffic.

This is how routing works
  • Router share data with each other via a protocol known as Border Gateway Protocol (BGP) which lets them learn about the most optimal paths to forward traffic.

  • Routers are like global guides to getting traffic to the right places.

Unicast: One device to transmit data to one other device.

  • At Ethernet, this is done by looking at a special bit in the destination MAC address.

  • If the least significant bit in the first octet of a destination address is set to zero, it means that the ethernet frame is intended for only the destination address.

Multicast:

  • A multicast frame is set to all devices on the local network signal.

  • If the least significant bit in the first octet of a destination address is set to one, it means you're dealing with a multicast frame.

  • Network interfaces can be configured to accept lists of configured multicast addresses for these sorts of communication.

Broadcast:

  • An Ethernet broadcast is sent to every single device on a LAN using a broadcast address.

    • FF:FF:FF:FF:FF:FF

  • Ethernet broadcasts are used so that devices can learn more about each other.

Dissecting An Ethernet Frame

Data packet: An all-encompassing term that represents any single set of binary data being sent across a network link. Ethernet frame is usually limited in size to 1,518 bytes

Data packets at the Ethernet level are known as Ethernet frames. An Ethernet frame is a highly structured collection of information presented in a specific order. This way network interfaces at the physical layer can convert a string of bits, traveling across a link into meaningful data or vice-versa.

Ethernet frame breakdown. (note: there is a typo in the graphic. In place of 8 bytes, it should have been 7 bytes.
  • Preamble: A seven bytes (or 56 bits) series of alternating ones and zeros. The preamble gives a receiving NIC time to realize a frame is coming and to know exactly where the frame starts and can also be used by the network interfaces to synchronize internal clocks they use to regulate the speed at which they send data.

  • Start Frame Delimiter (SFD): It signals to a receiving device that the preamble is over and the actual frame content will now follow.

  • Destination MAC address: The hardware address of the intended recipient

  • Source MAC address: The hardware where the frame originated from

  • VLAN header: Indicates that the frame itself is what's called a VLAN frame. If a VLAN header is present, the EtherType field follows it.

    • VLAN (Virtual LAN): A technique that lets you have multiple logical LANs operating on the same physical equipment.

      • A frame with a VLAN tag will only be delivered out of a switch interface configured to relay that specific tag.

      • This way you can have a single physical network that operates like it's multiple LANs.

      • VLANs are usually used to segregate different forms of traffic

  • EtherType field: 16 bits long and used to describe the protocol of the contents of the frame

  • Payload: In networking terms, is the actual data being transported, which is everything that isn't a header. It can be anywhere from 46 to 1500 bytes long. It contains all of the data from a higher layer such as the IP, transport, and application layers that are actually being transmitted.

  • Frame Checksum Sequence (FCS): A 4-byte (or 32-bit) number that represents a checksum value for the entire frame.

    • This checksum value is calculated by performing what's known as a cyclical redundancy check against the frame.

      • Cyclical Redundancy Check (CRC): An important concept for data integrity, and is used all over computing, not just network transmissions.