9.4. The Transmission Control Protocol - Internet Protocol (TCP IP) - Concise
9.4. The Transmission Control Protocol - Internet Protocol (TCP IP) - Concise
www.pmt.education
Specification:
4.9.4.1 TCP/IP:
Describe the role of the four layers of the TCP/IP stack (application,
transport, network, link)
Describe the role of sockets in the TCP/IP stack
Be familiar with the role of MAC (Media Access Control) addresses
Explain what the well-known ports and client ports are used for and the
differences between them.
www.pmt.education
4.9.4.3 IP address structure:
Know that an IP address is split into a network identifier part and a host
identifier part
4.9.4.5 IP standards:
Know that there are currently two standards of IP address, v4 and v6
Know why v6 was introduced
www.pmt.education
TCP / IP
Layer Role
Transport ● Establishes a virtual path between the sender and the receiver
● Splits the transmission into packets
● Each packet has a sequence number which identifies a packet’s
position in relation to other packets that form part of the same
message
● Also contained in each packet is the port number to be used
which identifies the protocol in use
Network ● Provides the correct IP addresses for each packet’s source and
destination
● Routers work within the network layer, using the IP addresses on
a packet to send it to its destination.
www.pmt.education
At the receiving end
● Once a packet has been received by its intended recipient, it is stripped of its extra
information by reversing the TCP / IP stack
○ The link layer removes MAC addresses from the packet
○ The network layer removes IP addresses
○ The transport layer uses the packet’s port number to determine the correct
application to send the packet to
○ The transport layer also uses the packet’s sequence number to ensure that it
is in the correct position relative to other packets in the same transmission
○ The application layer receives the packets and displays the information to the
user accordingly
Socket addresses
● Formed of an IP address, followed by a colon, followed by the port number in use
● Identifies which application on the recipient device a packet should be sent to
Well-known ports
www.pmt.education
The structure of IP addresses
IP address standards
IPv4
● IPv4 addresses are dotted quad numbers
● They consist of four parts that are separated by dots
● Each of the four parts of an IPv4 address is assigned one byte (eight bits) allowing
for numbers from 0to 255to be represented
● There are slightly over 4 billion (2564) unique IPv4 addresses
● IPv4 addresses are in short supply
● The number of devices on the Internet that require a routable IP address is
increasing so rapidly that a new version of IP address had to be created
IPv6
● IPv6 addresses are formed of eight blocks separated by colons
● Each block contains four hexadecimal characters (a-z and 0
-9
)
● IPv6 addresses use 128 bits which allows for far more unique permutations than
IPv4 addresses
www.pmt.education
Public and private IP addresses
● The number of available private IP addresses within a private network is limited
● DHCP is used to assign IP addresses to devices as they join a network
● DHCP uses a pool of available IP addresses to allocate IP addresses
● IP addresses are allocated for the duration of a device’s session
● Once a device leaves the network, the IP address that the device was using is
returned to the pool for reallocation
● Routers have two network interface cards, one for their private network and one for
the Internet
● Therefore, routers have two IP addresses, a private address and a public address
● When a computer on the private network communicates with a device on the
Internet, the device couldn’t respond to the computer directly because the
computer’s IP address is not globally unique
● NAT gets around this problem. When a device on the private network needs to
communicate with a device on the Internet, it sends packets through the router,
which:
○ makes a record of the packet
○ replaces the private IP address of the computer with its own routable IP
address
● When a response is received, it is sent to the router’s public IP address, which then
forwards the response to the correct private IP address by using the record it made
when sending the packet
www.pmt.education
Port forwarding
● Port forwarding is used when a client needs to communicate with a server that is
connected to a private network
● The client sends packets to the public IP address of the router belonging to the
server’s private network
● The packets sent by the client contain the port number of the application running on
the server that the client wishes to access
● The private network’s router then forwards the packets to the server using NAT
● In a network that uses the client server model, clients send request messages to
servers, which reply to the clients with response messages
● These messages may contain
○ requested information
○ a confirmation that a requested action has been completed
○ a message explaining why the requested action hasn’t been completed
APIs
● Stands for application programming interface
● A set of protocols relating to how different applications communicate with each
other
● Define how interaction between the applications should be carried out
● Allows applications to make use of other applications
www.pmt.education
Web CRUD Applications and REST
CRUD
● An acronym for create, retrieve, update, delete
● Four commands that can be used to query online databases
● Each of the four CRUD commands has a SQL equivalent
CRUD SQL
Create INSERT
Retrieve SELECT
Update UPDATE
Delete DELETE
REST
● Acronym for representational state transfer
● A design methodology for online database applications that are queried with a web
browser
● Uses the four HTTP request methods POST, GET, PUT and DELETE to query
databases
HTTP SQL
POST INSERT
GET SELECT
PUT UPDATE
DELETE DELETE
www.pmt.education
XML and JSON
● Database servers deliver responses to queries using either XML or JSON
● XML stands for extensible markup language
● JSON stands for JavaScript object notation
● JSON is more compact, easier to read, easier to create and faster for computers to
process than XML
● XML is sometimes seen to be more flexible than JSON
XML JSON
{
"Department": {
<Department> "Subject": [
<Subject> {
<Name>Physics</Name> "Name": "Physics",
<Board>Edexcel</Board> "Board": "Edexcel"
</Subject> },
<Subject> {
<Name>Maths</Name> "Name": "Maths",
<Board>AQA</Board> "Board": "AQA"
</Subject> }
</Department> ]
}
}
www.pmt.education
Thin- and thick-client computing
Thin-client networks
● The majority of the network’s processing power belongs to servers
● Servers provide services and resources including storage and processing
● It’s easy to add new clients and the clients themselves are inexpensive machines
● Software updates and security can be managed from the server, allowing for
greater centralised control of the network
● Require a powerful server which is expensive and requires expertise to set up and
maintain
Thick-client networks
● The clients are powerful enough to provide their own processing power and storage
● This independence eliminates the requirement for a server, although it is possible
for thick-client networks can make use of a server
● Require more powerful clients than thin-client networks, making the network
expensive to set up
● The cost and expertise required in setting up and maintaining an expensive server
is done away with
● Thick-client networks are harder to maintain because there is no facility to issue
updates and manage security from a central server
● Compared to thin-client networks which suffer from high volumes of traffic
communicating between clients and the server, thick-client networks boast much
quieter communication channels which reduces the likelihood of data collisions
www.pmt.education