X) TCP / IP / Client-server Model Flashcards
What is a Protocol and Protocol stack?
A protocol is a set of rules that specify how two or more devices communicate with one another.
In a protocol stack, protocols are used in a series of functional layers and ensuring the data is sent from one layer to another layer, before being sent out onto the media for transmission.
Encapsulation & Decapsulation
A method of modular communication, where data is taken from the layer above, the data is then given some additional information, then passed to the layer below.
The process of a layer taking data from the data packet recived, then passes the rest of the data to the layer above.
Layer 4 - Application Layer
This layer uses appropriate protocols relating to whatever application is being used to transmit data. Protocol Examples: HTTP, HTTPS, POP3, FTP, SMTP.
Layer 3 - Transport Layer
This layer is responsible for establish an “end to end” connection. Once a connection has been made, the data is split and is transmitted as packets.
At the receiving end, the layer confirms that all packets have been received and requests data if any are missing.
Layer 2 - Network Layer
For each packet a source IP address and destination IP address is added. E.g. 127.56.87.2 : 80
Socket = IP Address : Port Number
Layer 1 - Link Layer
This layer represents the physical connection between the various network nodes. The Media Access Control Address (MAC Address) is added to each packet. The packets are then sent based on their destination IP Address.
MAC Address
The MAC Address is a unique identifier, 12 digit hexadecimal code. This identifier is used to identify a specific physical device. E.g. 4B:24:A2:73:0E:F1
281 Trillion possibilities.
Receiving data
Once the data packets have been received, it is passed back up through the layers.
- The link layer removed the MAC address
Port Numbers
A port is used to alert a specific application to deal with data sent to a computer. They are used by protocols to specify what data is being sent. HTTP - 80 HTTPS - 443 POP3 - 110 SMTP - 25 FTP - 20
Secure Shell
An encrypted protocol that allows secure communication between nodes across a network. Secure Shell tunnelling is used to pass data through where otherwise it might have been blocked.
Email Protocols
Mail servers are dedicated computers which are responsible for storing and provide access to emails.
SMTP- Used to send emails between the mail server and their destination.
POP3- Downloads emails stored on a server to a local client.
IMAP- Manages emails on a server so multiple clients can access the same email account.
Web Servers
Some computers are dedicated to host websites and provide resources. Data stored are either in the format of HTML or JavaScript and are then separated down into their constituents parts.
These text elements are broken down further and rendered on the client browser. Images, Videos or scripts are also downloaded as the webpage is rendered.
Web servers make use of protocols such as HTTP to ensure that all data is handled correctly.
What is an IP Address?
A unique identifier for a host computer or network node trying to connect over IP on a network.
IPv4 Addresses
Used 4 (octets) groups of 8 bits written in decimal-dotted notation:
10101011.00001111.10101010.11100010
Example:
5D26:93AC:0007:492F
Range of:
0.0.0.0 - 255.255.255.255
2 ^ 32 = 4.3 Billion Addresses
Reserved IP Addresses
X.Y.Z.0 - represents the entire network
X.Y.Z.255 - represents the broadcast address, used for sending data simultaneously to all hosts on a network.
127.X.Y.Z - represents loopback, in which a host’s IP software, treats an outgoing packet as incoming.
Why is IPv6 is better than IPv4?
IPv4 = 256^4 = 4.3 Billion combinations
Not enough for the level of devices being manufactured.
IPv6- 128 bits (8 octets)
Example:
5D26:93AC:0007:492F:5D26:93AC:0007:492F
IPv6 = 256 ^ 16= 3.4x10^38 possible addresses
Every atom covering the Earth’s surface +100 times over.
Network and Host Identifiers
IP Address broken down into a Network ID and Host ID.
For this example, 16 bits represent each sub ID.
IP Address: 142.67.57.253
Network ID: 142.67.0.0
Host ID: 0.0.57.253
Classless IP Addressing
The more hosts in each network, the fewer networks that can be created.
210.54.101.0 /24
Network ID = 24 bits –> 3 octets
Network ID = 210.54.101 = 16.8 million
Host ID = 0.0.0.0 = 256
What is a subnet mask?
The subnet mask is used to define the Network ID and this can be segmented to however the administrator sees fit.
How a subnet mask identifies the Network ID within the IP Address?
142.27.114.56 / 24
142.27.114.56 / 24
IP Address = 10001110.00011011.01110010.00111000
All Network ID bits set to 1. All Host ID bits set to 0. SubNet = 11111111.11111111.11111111.00000000 1 AND 1 = 1 0 AND 1 = 0 1 AND 0 = 0 0 AND 0 = 0 Network ID = 10001110.00011011.01110010.00000000
Public and Private IP Address
Example of an address that is considered to be private:
10.0.0.1 - 10.255.255.255
This address is non-routable across the Internet and reserved for LANs or private WANs.
This reduces the need for every computer to have its own unique public address.
Network Address Translation (NAT)
Devices using IP addresses cannot access the internet directly. A client having a single IP address is shared across all hosts on a private IP address.
NAT is responsible for converting IP addresses as they pass over the board are between public and private address spaces.
NAT Process
The translation device (router) records the source and destination address for a request. It then communicates on the host’s behalf with the destination IP address, when a respond returns it sends it back to the host address.
Port Forwarding
A method of routing data through additional ports, it is used to provide services to clients on the internet.
Dynamic Host Configuration Protocol (DHCP)
A set of rules for allocating IP addresses to devices, so the devices can connect to a network.
How a DHCP works?
A DHCP can assign a limited number of temporary IP addresses to devices that are operating on a local hotspot.
- DHCP Discover- device broadcasts for a request.
- DHCP Offer- A DHCP server sends an IP address available to connect to.
- DHCP Request- device confirms the IP address request.
- DHCP Pack- server acknowledges and assigns the device a dynamic IP address.
What is the client-server model?
Is a methodology for connecting clients together over a network, where a server provides access to resources for other computers connected to it.
How does the client-server model work?
A client sends a request to the server, in turn, the server responds to the request and provides the service being requested.
Application Programming Interface (APL)
API is a set of subroutines that enable one program to interface with another program.
HTTP Communication
The issues with HTTP is that the client has to request data from the server if too much time passes between establishing a socket, the server drops the connection and returns an error message.
408 Request Timeout.
WebSocket
This protocol creates a persistent connection between two computers on a network to enable each to simultaneously exchange data in both directions.
Domain Name Server (DNS)
DNS are dedicated computers with an index of domain names and their corresponding IP addresses.
When a computer queries a DNS server for a domain name, the server returns the corresponding IP address.
Domain Name System
Several DNS servers work to catalogue every web domain name, these are segmented into geographical groupings.
If the IP address of a domain is not known, a query is related domain server that could know.
Resolving an IP address
- FInd bbc.co.uk - the domain name is resolved from right to left.
- Local DNS doesn’t know the domain name
- Root DNS server may know where .UK server is.
- Once found .UK server, server refers to .co server.
- Finds BBC server and resolved for IP address.
- Returns IP address
Internet Registries
Internet registries are organisations that allocate domain names and IP addresses.
Domain names must be unique because it does not allow two parties to hold the same domain name as this can create a problem and will defeat the purpose of building your brand identity.
File Transfer Protocol (FTP)
Secure Shell Protocol (SSH)
FTP is a protocol used for handling file uploads and downloads.
SSH is a protocol used for gaining remote access to a computer.
Circuit Switching
Circuit switching involves creating a physical communication network between two endpoints for the duration of a data transfer.
Packet Switching
Packet switching was developed to allow for data to flow via the fastest route on a network. It is to allow a communications channel to be shared so that when one communication was temporarily not using it another could.
Data Packets
Data packets are blocks of data, which are reassembled once they are received. This process is used to increase network efficiency and reliability.
Routing
Routing is a process of directing packets of data between networks.
Routers are used to forward one packet of data from one network to another.
- Each router stores data about routes to the destination node.
- The router looks up the destination IP address in its routing table to find the best route to forward the packet.
- Each forwarding transfer is called a hop.
- Routers continue to forward the packet until it reaches its destination node.
What is in a Packet?
Header- senders IP address, recipients IP address, the protocol being used and packet number.
Payload- the data
Trailer- a checksum
A checksum is a method for checking the integrity of the data, by calculating a sum based on the data being sent.
Packet Size
Packets must be kept small to ensure that individual packets do not take an excessively long time to transfer. But must not be too small as the additional information added makes data transfer inefficient.
(500- 1500 bytes)
Gateways
A gateway is a node on a network that acts as a connection point to another network with different protocols.
The data header is removed and reapplied using the correct format on the new network.
Half-Adder
Adders are found in the ALU, they take two bits (A and B) and add them to create a sum. There is a further bit called a carry bit for when the result of the sum requires a further digit. Eg. 1 + 1 = 10 (i.e. 0 carry 1).
A half-adder is a circuit that performs addition using inputs from only A and B.
A half-adder calculates the sum and stores the value carry bit C as well as the result S.
Full-Adder
A full-adder is a circuit that performs addition using inputs from A and B plus a carry bit.
Full-adders take 3 inputs, which are two binary numbers plus a carry bit from a previous calculation.
Edge-triggered D-type flip-flop
An Edge-triggered D-type flip-flop is a logic circuit that can be used to store the value of a single binary digit.
The D-type flip-flop has two inputs: a data signal and a clock signal, on each signal from the clock, the state of the data input is stored and the output is updated.
Whenever the clock signal is on, the data input is set as the output.
Whenever the clock signal is off, the circuit outputs the previous value.
Clock D(Data) Q (Output)
0 0 Previous value of Q
0 1 Previous value of Q
1 0 0
1 1 1