Networking and Internet

Internet →

Backbone = High speed network that monitors network trafficking

e.g. British telecom →

Internet Service Provider = organisation provides internet access

e.g. BT

Sending data over internet →

Packet = unit of data that is sent over the internet

Router = directs packets between networks until it reaches final destination

Routing Table = determines next best hop transition to another router

. Routers are always listening for any packet with any port number

Packet Switching = splits data into packets, that are fixed-sized and numbered, and are reassembled upon destination

Format of a packet:

Header → Source IP and Destination IP, TTL(TIme To Live)

Payload → Data, Packet ID

THINGS TO NOTE BEFORE:

. Sockets are the combinations of the port number (application), IP address and Protocal (TCP or UDP)

. This socket for the application is already initialised on the receiver’s end, whether that is you receiving back the data on the application using the port number, or it is the server you are requesting data from.

TCP/IP Stack →

Application Layer →

Responsible for the communication of the end-user application:

. Port number is obtained by the OS basing it on the application being used

e.g. Safari → HTTP → port 80

. Creates and establishes socket using programming API (python ‘socket’ module)

Transport Layer (establishes connection using handshake) →

. Uses the socket to determine the protocal: Transmission Communication Protocal or User Datagram Protocal

Difference between TCP and UDP:

TCP-

. uses three-way handshake

. does care about the errors within transmitting (more secure)

UDP-

. does not use the three-way handshake

. does not care about errors when transmitting (less secure)

. The packets are split into segments called packets

. Each packet is assigned a header (so the order is remembered upon transmission)

Network Layer →

. IP = deals with the routing and delivering of the packets acrooss a network to the destination. It also adds the source and destination IP address to the header.

(Basically determines the best route for the packets)

Link Layer →

. Applies MAC address here to identify the device upon receival:

- ARP (Address Resolution Protocal) is used if the destination is LAN

- If the destination is not local, then the destination routers MAC address is used

. Signal conversion

Packet Arrival →

. Servers are always listening for specific packets using the same port number

Once the packets have arrived at destination the TCP/IP stack is used again, however it is flips: Link Layer, Network Layer, Transport Layer, Application Layer