SlideShare a Scribd company logo
1 of 47
1
2
C/Embedded Base Camp
Networking essentials.
Lecture 3
Petro Shevchenko
Maksym Vysochinenko
October 2021
3
1. Transport Layer (L4)
2. UDP Overview
3. TCP Communication Process
4. The Socket API
5. Tools and Utilities
Agenda
4
Transport Layer (L4)
5
Transport Layer
Role of the Transport Layer
● Responsible for establishing a
temporary communication session
between two applications and delivering
data between them.
● Link between the application layer and
the lower layers that are responsible for
network transmission.
6
Transport Layer
Transport Layer Functions
● Data Segmentation
○ The Transport layer divides the
data into pieces and adds a
header for delivery over the
network
● Addressing
○ For addressing at the transport
level, ports are used, a number
from 1 to 65535.
○ Port numbers are associated with
processes on a host and must be
unique
7
Transport Layer
Socket Pairs
• The source and destination ports are placed
within the segment.
• The segments are then encapsulated within an
IP packet.
• The combination of the source IP address and
source port number, or the destination IP
address and destination port number is known
as a socket.
• Sockets enable multiple processes, running on a
client, to distinguish themselves from each
other, and multiple connections to a server
process to be distinguished from each other.
8
Transport Layer
Port Number Groups
▪ Well-known Ports (Numbers 0 to 1023) - These numbers are reserved for services
and applications.
▪ Registered Ports (Numbers 1024 to 49151) - These port numbers are assigned by
IANA to a requesting entity to use with specific processes or applications.
▪ Dynamic or Private Ports (Numbers 49152 to 65535) - Usually assigned
dynamically by the client’s OS and used to identify the client application during
communication.
9
Transport Layer
Port Number Groups (Cont.)
Well Known
Port
Numbers
10
Transport Layer
Transport Layer Reliability
▪ TCP/IP provides two transport layer
protocols:
• Transmission Control Protocol (TCP)
• Considered reliable which ensures
that all of the data arrives at the
destination.
• Additional fields needed in header
which increases size and delay.
• User Datagram Protocol (UDP)
• Does not provide for reliability.
• Fewer fields and is faster than TCP.
11
▪ TCP - databases, web
browsers, and email
clients require that all data
that is sent arrives at the
destination in its original
condition.
▪ UDP - if one or two
segments of a live video
stream fail to arrive, if
disruption in the stream,
may not be noticeable to
the user.
Transport Layer
The Right Transport Layer Protocol for the Right Application
12
User Datagram Protocol (UDP)
Overview
13
UDP Overview
UDP Features
▪ UDP is a stateless protocol – no
tracking
▪ Reliability handled by application
14
UDP Overview
UDP Low Overhead versus Reliability
▪ UDP not connection-
oriented
▪ No retransmission,
sequencing, and flow
control
▪ Functions not provided
by the transport layer
implemented
elsewhere
15
UDP Overview
UDP Datagram Reassembly
UDP: Connectionless and Unreliable
▪ UDP reassembles data
in order received and
forwards to application
▪ Application must identify
the proper sequence
16
UDP Overview
UDP Header
● Source Port - This field identifies the sender's port
● Destination Port - This field identifies the receiver's port
● Length - This field specifies the length in bytes of the UDP header and UDP data
● Checksum - The checksum field may be used for error-checking of the header and data
17
UDP Overview
Applications that use UDP
Three types of applications best
suited for UDP:
● Live video and multimedia
● Simple request and reply
● Handle reliability
themselves
18
Transmission Control Protocol (TCP)
Communication Process
19
TCP Communication Process
TCP Reliability- Guaranteed and Ordered Delivery
• TCP can also help maintain the flow of
packets so that devices do not become
overloaded.
• There may be times when TCP segments do
not arrive at their destination or arrive out
of order.
• All the data must be received and the data
in these segments must be reassembled into
the original order.
• Sequence numbers are assigned in the
header of each packet to achieve this goal.
20
Reliability and Flow Control
TCP Flow Control – Maximum Segment Size
Maximum Segment Size (MSS) is the
maximum amount of data that the
destination device can receive.
• A common MSS is 1,460 bytes when
using IPv4.
• A host determines the value of its MSS
field by subtracting the IP and TCP
headers from the Ethernet maximum
transmission unit (MTU), which is 1500
bytes be default.
• 1500 minus 40 (20 bytes for the IPv4
header and 20 bytes for the TCP
header) leaves 1460 bytes.
21
TCP Communication Process
TCP Header Format (RFC 793)
Source Port - The source port number (16 bits)
Destination Port - The destination port number (16
bits)
Sequence Number - The sequence number of the
first data octet in this segment (32 bits)
Acknowledgment Number - If the ACK control bit is
set this field contains the value of the next
sequence number the sender of the segment is
expecting to receive (32 bits)
Data Offset - The number of 32 bit words in the TCP
Header. This indicates where the data begins (4
bits)
Reserved - Reserved for future use. Must be zero
(6 bits)
22
TCP Communication Process
TCP Header Format (Cont.)
Flags - The six control bit flags are as follows:
● URG: Urgent Pointer field significant
● ACK: Acknowledgment field significant
● PSH: Push Function
● RST: Reset the connection
● SYN: Synchronize sequence numbers
● FIN: No more data from sender
Window - The number of data octets beginning
with the one indicated in the acknowledgment
field which the sender of this segment is willing
to accept (16 bits)
Checksum - The header and data checksum
(16 bits)
Urgent Pointer - The urgent pointer points to the
urgent data (16 bits)
Options - The Options have variable length
data - The segment data have variable length
23
TCP Communication Process
TCP Connection Establishment
Step 1: The initiating client requests a client-to-server
communication session with the server.
Step 2: The server acknowledges the client-to-server
communication session and requests a server-to-client
communication session.
Step 3: The initiating client acknowledges the server-
to-client communication session.
Main tasks:
1 – Synchronize counters SEQ ACK
2 – Define algorithms
3 – Measure RTT – round-trip time
>> calculate RTO Retransmission timeout
24
TCP Communication Process
Session Termination
Step 1: When the client has no more data to
send in the stream, it sends a segment with the
FIN flag set.
Step 2: The server sends an ACK to
acknowledge the receipt of the FIN to
terminate the session from client to server.
Step 3: The server sends a FIN to the client to
terminate the server-to-client session.
Step 4: The client responds with an ACK to
acknowledge the FIN from the server.
25
TCP Communication Process
Sequence Numbers and Acknowledgments
26
TCP Communication Process
Window Sliding
● There is two way to send TCP segments:
○ The sender sends one segment and
waits for an acknowledgment, after
that it sends the next segment
○ The sender sends several segments
one-by-one without waiting for an
acknowledgment, this is called
window sliding
● The internal device buffer can be of limited
size, so the window size must not exceed
this value
● The sender after sending the data by the
window size stops the transmission waiting
for an acknowledgment
● After confirming reception, the sender
continues to transmit
27
Reliability and Flow Control
TCP Reliability – Data Loss and Retransmission
No matter how well designed a network is,
data loss occasionally occurs.
TCP provides methods of managing these
segment losses. Among these is a mechanism
to retransmit segments for unacknowledged
data.
28
Reliability and Flow Control
TCP Reliability – Data Loss and Retransmission (Cont.)
Host operating systems today typically employ
an optional TCP feature called selective
acknowledgment (SACK), negotiated during the
three-way handshake.
If both hosts support SACK, the receiver can
explicitly acknowledge which segments (bytes)
were received including any discontinuous
segments.
29
Reliability and Flow Control
TCP Flow Control – Retransmits
▪ Congestion causes
retransmission of lost TCP
segments
▪ Retransmission of segments can
make the congestion worse
▪ To avoid and control congestion,
TCP employs several congestion
handling mechanisms, timers,
and algorithms
▪ Example: Reduce the number of
bytes it sends before receiving
an acknowledgment
▪ RTO – retransmission timeout
30
The Socket API
31
The Socket API
32
The Socket API
33
Tools and Utilities
34
Tools and utilities overview
ifconfig - configure a network interface
nmcli - command-line tool for controlling NetworkManager
route - show / manipulate the IP routing table
ping - send ICMP ECHO_REQUEST to network hosts
traceroute - Trace the route to a host
netstat - Print network connections, routing tables, interface statistics
dig - DNS lookup utility
ncat - Concatenate and redirect sockets
nmap - Network exploration tool and security / port scanner
tcpdump - dump traffic on a network
wireshark - Interactively dump and analyze network traffic
35
NAME
ifconfig - configure a network interface
SYNOPSIS
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time
to set up interfaces as necessary. After that, it is usually only needed when debugging or
when system tuning is needed.
36
NAME
nmcli - command-line tool for controlling NetworkManager
SYNOPSIS
nmcli [OPTIONS...] {help | general | networking | radio | connection | device | agent | monitor} [COMMAND] [ARGUMENTS...]
DESCRIPTION
nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as a r
eplacement for nm-applet or other graphical clients. nmcli is used to create, display, edit, delete, activate, and
deactivate network connections, as well as control and display network device status.
37
NAME
route - show / manipulate the IP routing table
SYNOPSIS
route [-CFvnNee] [-A family |-4|-6]
route [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod]
[dyn] [reinstate] [[dev] If]
route [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric M] [[dev] If]
route [-V] [--version] [-h] [--help]
38
NAME
ping - send ICMP ECHO_REQUEST to network hosts
SYNOPSIS
ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I
interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N node info_option] [-w deadline] [-W timeout] [-p pattern] [-Q
tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop ...] destination
DESCRIPTION
ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit
an ICMP ECHO_RESPONSE from a host or gateway.
39
NAME
traceroute - Trace the route to a host
SYNOPSIS
traceroute [OPTION...] HOST
DESCRIPTION
Print the route packets trace to network host.
-f, --first-hop=NUM Set initial hop distance, that is the time-to-live.
-g, --gateways=GATES List of gateways for loose source routing.
-I, --icmp Use ICMP ECHO as probe.
40
NAME
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
SYNOPSIS
netstat [address_family_options] [--tcp|-t] [--udp|-u] [--udplite|-U] [--sctp|-S] [--raw|-w] [--l2cap|-2] [--rfcomm|-f] [--listening|-
l] [--all|-a] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--
timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c] [--wide|-W]
netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts]
[--numeric-ports] [--numeric-users] [--continuous|-c]
41
NAME
dig - DNS lookup utility
SYNOPSIS
dig [@server] [-b address] [-c class] [-f filename] [-k filename] [-m] [-p port#] [-q name] [-t type] [-v] [-x addr] [-y
[hmac:]name:key] [[-4] | [-6]] [name] [type] [class] [queryopt...]
dig [-h]
dig [global-queryopt...] [query...]
DESCRIPTION
dig is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned
from the name server(s) that were queried. Most DNS administrators use dig to troubleshoot DNS problems because of its
flexibility, ease of use and clarity of output. Other lookup tools tend to have less functionality than dig.
42
NAME
ncat - Concatenate and redirect sockets
SYNOPSIS
ncat [OPTIONS...] [hostname] [port]
DESCRIPTION
Ncat is a feature-packed networking utility which reads and writes data across networks from the command line. Ncat was
written for the Nmap Project and is the culmination of the currently splintered family of Netcat incarnations.
-p, --source-port port Specify source port to use
-s, --source addr Specify source address to use (doesn't affect -l)
-l, --listen Bind and listen for incoming connections
-k, --keep-open Accept multiple connections in listen mode
-n, --nodns Do not resolve hostnames via DNS
-t, --telnet Answer Telnet negotiations
-u, --udp Use UDP instead of default TCP
Echo server - ncat -l 12345 -k -c 'xargs -n1 echo'
Server Client
43
NAME
nmap - Network exploration tool and security / port scanner
SYNOPSIS
nmap [Scan Type...] [Options] {target specification}
DESCRIPTION
Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly
scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what
hosts are available on the network, what services (application name and version) those hosts are offering, what operating
systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics.
44
NAME
tcpdump - dump traffic on a network
SYNOPSIS
tcpdump [ -AbdDefhHIJKlLnNOpqStuUvxX# ] [ -B buffer_size ]
[ -c count ]
[ -C file_size ] [ -G rotate_seconds ] [ -F file ]
[ -i interface ] [ -j tstamp_type ] [ -m module ] [ -M secret ]
DESCRIPTION
Tcpdump prints out a description of the contents of packets on a network interface that match the boolean expression; the
description is preceded by a time stamp, printed, by default, as hours, minutes, seconds, and fractions of a second since
midnight.
tcpdump -i eth0
tcpdump host 1.1.1.1
tcpdump port 80 -w capture_file.pcap
45
NAME
wireshark - Interactively dump and analyze network traffic
SYNOPSIS
wireshark [ -a <capture autostop condition> ] ...
[ -b <capture ring buffer option> ] ... [ -B <capture buffer size> ]
[ -c <capture packet count> ] [ -C <configuration profile> ]
DESCRIPTION
Wireshark is a GUI network protocol analyzer. It lets you interactively browse packet data from a live network or from a
previously saved capture file. Wireshark's native capture file format is pcap format, which is also the format used by tcpdump and
various other tools.
46
Homework #2. Preparation to practice
1. Install examples:
a. Log into your GitHub account and fork the following repository
https://github.com/PetroShevchenko/GL-ESK-ETHERNET
b. Clone the repository from your GitHub account into a local repository by running
the following command
user@host:~$ git clone https://github.com/<githubusername>/GL-ESK-ETHERNET.git
2. Import cloned project into STM32Cube IDE workspace
3. Build the project and upload the firmware to the GL ESK
4. Power off the board then plug-in an Ethernet cable to the board. Power on the board
5. DHCP uses to assign a new IP address of the board. If successful, you will see the
assigned IP address on the LCD
47
Thank You

More Related Content

What's hot

TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)Kruti Niranjan
 
Ports and protocols
Ports and protocolsPorts and protocols
Ports and protocolssiva rama
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets myrajendra
 
Lesson.7: Configuring IP Routing A
Lesson.7: Configuring IP Routing ALesson.7: Configuring IP Routing A
Lesson.7: Configuring IP Routing AMahmmoud Mahdi
 
Computer Network Syllabus
Computer Network SyllabusComputer Network Syllabus
Computer Network SyllabusMeenakshi Paul
 
Cs553 st7 ch18-internet_protocols
Cs553 st7 ch18-internet_protocolsCs553 st7 ch18-internet_protocols
Cs553 st7 ch18-internet_protocolsKathirKathiresan4
 
Transport Layer in Computer Networks (TCP / UDP / SCTP)
Transport Layer in Computer Networks (TCP / UDP / SCTP)Transport Layer in Computer Networks (TCP / UDP / SCTP)
Transport Layer in Computer Networks (TCP / UDP / SCTP)Hamidreza Bolhasani
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CSThanveen
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68myrajendra
 
16 coms 525 tcpip - routing protocols -all
16    coms 525 tcpip - routing protocols -all16    coms 525 tcpip - routing protocols -all
16 coms 525 tcpip - routing protocols -allPalanivel Kuppusamy
 
20 common port numbers and their purposes
20 common port numbers and their purposes 20 common port numbers and their purposes
20 common port numbers and their purposes salamassh
 
Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1Tutun Juhana
 
Transport layer udp and tcp network
Transport layer udp and tcp networkTransport layer udp and tcp network
Transport layer udp and tcp networkHamzahMohammed4
 

What's hot (20)

TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Ports and protocols
Ports and protocolsPorts and protocols
Ports and protocols
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
 
Lesson.7: Configuring IP Routing A
Lesson.7: Configuring IP Routing ALesson.7: Configuring IP Routing A
Lesson.7: Configuring IP Routing A
 
Transport layer
Transport layerTransport layer
Transport layer
 
Tcp udp
Tcp udpTcp udp
Tcp udp
 
Computer Network Syllabus
Computer Network SyllabusComputer Network Syllabus
Computer Network Syllabus
 
rip, ospf 13-14
rip, ospf 13-14rip, ospf 13-14
rip, ospf 13-14
 
Cs553 st7 ch18-internet_protocols
Cs553 st7 ch18-internet_protocolsCs553 st7 ch18-internet_protocols
Cs553 st7 ch18-internet_protocols
 
Well known protocols port numbers
Well known  protocols port numbersWell known  protocols port numbers
Well known protocols port numbers
 
Transport Layer in Computer Networks (TCP / UDP / SCTP)
Transport Layer in Computer Networks (TCP / UDP / SCTP)Transport Layer in Computer Networks (TCP / UDP / SCTP)
Transport Layer in Computer Networks (TCP / UDP / SCTP)
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CS
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68
 
16 coms 525 tcpip - routing protocols -all
16    coms 525 tcpip - routing protocols -all16    coms 525 tcpip - routing protocols -all
16 coms 525 tcpip - routing protocols -all
 
20 common port numbers and their purposes
20 common port numbers and their purposes 20 common port numbers and their purposes
20 common port numbers and their purposes
 
Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Transport layer udp and tcp network
Transport layer udp and tcp networkTransport layer udp and tcp network
Transport layer udp and tcp network
 

Similar to Networking essentials lect3

Computer networks transport layer
Computer networks  transport layerComputer networks  transport layer
Computer networks transport layerjamunaashok
 
Unit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxUnit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxDESTROYER39
 
Unit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxUnit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxsarosh32
 
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptxVINAYTANWAR18
 
tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxAlphaKoiSylvester
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP PresentationHarish Chand
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9Waqas Ahmed Nawaz
 
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesREMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesRhydham Joshi
 
LECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptLECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptMonirHossain707319
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxGirT2
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxNischayBahl1
 
Transport Layer [Autosaved]
Transport Layer [Autosaved]Transport Layer [Autosaved]
Transport Layer [Autosaved]Ram Dutt Shukla
 
the transport layer
the transport layerthe transport layer
the transport layertumetr1
 

Similar to Networking essentials lect3 (20)

Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
 
User Datagram Protocol
User Datagram ProtocolUser Datagram Protocol
User Datagram Protocol
 
Computer networks transport layer
Computer networks  transport layerComputer networks  transport layer
Computer networks transport layer
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Unit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxUnit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptx
 
Unit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxUnit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptx
 
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
 
tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptx
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Tcp ip presentation
Tcp ip presentationTcp ip presentation
Tcp ip presentation
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
 
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesREMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
 
LECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptLECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.ppt
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
 
TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Transport Layer [Autosaved]
Transport Layer [Autosaved]Transport Layer [Autosaved]
Transport Layer [Autosaved]
 
the transport layer
the transport layerthe transport layer
the transport layer
 
Lecture set 7
Lecture set 7Lecture set 7
Lecture set 7
 

More from Roman Brovko

Individual task Networking
Individual task NetworkingIndividual task Networking
Individual task NetworkingRoman Brovko
 
Networking essentials lect1
Networking essentials lect1Networking essentials lect1
Networking essentials lect1Roman Brovko
 
Bare metal training_07_spi_flash
Bare metal training_07_spi_flashBare metal training_07_spi_flash
Bare metal training_07_spi_flashRoman Brovko
 
Bare metal training_06_I2C
Bare metal training_06_I2CBare metal training_06_I2C
Bare metal training_06_I2CRoman Brovko
 
Bare metal training_05_uart
Bare metal training_05_uartBare metal training_05_uart
Bare metal training_05_uartRoman Brovko
 
Bare metal training_04_adc_temp_sensor
Bare metal training_04_adc_temp_sensorBare metal training_04_adc_temp_sensor
Bare metal training_04_adc_temp_sensorRoman Brovko
 
Bare metal training_03_timers_pwm
Bare metal training_03_timers_pwmBare metal training_03_timers_pwm
Bare metal training_03_timers_pwmRoman Brovko
 
Bare metal training_02_le_ds_and_buttons
Bare metal training_02_le_ds_and_buttonsBare metal training_02_le_ds_and_buttons
Bare metal training_02_le_ds_and_buttonsRoman Brovko
 
Bare metal training_01_hello_world
Bare metal training_01_hello_worldBare metal training_01_hello_world
Bare metal training_01_hello_worldRoman Brovko
 
Bare metal training_00_prerequisites
Bare metal training_00_prerequisitesBare metal training_00_prerequisites
Bare metal training_00_prerequisitesRoman Brovko
 
C language lect_23_advanced
C language lect_23_advancedC language lect_23_advanced
C language lect_23_advancedRoman Brovko
 
C language lect_22_advanced
C language lect_22_advancedC language lect_22_advanced
C language lect_22_advancedRoman Brovko
 
C language lect_21_advanced
C language lect_21_advancedC language lect_21_advanced
C language lect_21_advancedRoman Brovko
 
подготовка рабочего окружения
подготовка рабочего окруженияподготовка рабочего окружения
подготовка рабочего окруженияRoman Brovko
 
C language lect_20_advanced
C language lect_20_advancedC language lect_20_advanced
C language lect_20_advancedRoman Brovko
 
C language lect_19_basics
C language lect_19_basicsC language lect_19_basics
C language lect_19_basicsRoman Brovko
 
C language lect_18_basics
C language lect_18_basicsC language lect_18_basics
C language lect_18_basicsRoman Brovko
 
C language lect_17_basics
C language lect_17_basicsC language lect_17_basics
C language lect_17_basicsRoman Brovko
 
C language lect_16_basics
C language lect_16_basicsC language lect_16_basics
C language lect_16_basicsRoman Brovko
 

More from Roman Brovko (20)

Individual task Networking
Individual task NetworkingIndividual task Networking
Individual task Networking
 
Networking essentials lect1
Networking essentials lect1Networking essentials lect1
Networking essentials lect1
 
Bare metal training_07_spi_flash
Bare metal training_07_spi_flashBare metal training_07_spi_flash
Bare metal training_07_spi_flash
 
Bare metal training_06_I2C
Bare metal training_06_I2CBare metal training_06_I2C
Bare metal training_06_I2C
 
Glesk worshop
Glesk worshopGlesk worshop
Glesk worshop
 
Bare metal training_05_uart
Bare metal training_05_uartBare metal training_05_uart
Bare metal training_05_uart
 
Bare metal training_04_adc_temp_sensor
Bare metal training_04_adc_temp_sensorBare metal training_04_adc_temp_sensor
Bare metal training_04_adc_temp_sensor
 
Bare metal training_03_timers_pwm
Bare metal training_03_timers_pwmBare metal training_03_timers_pwm
Bare metal training_03_timers_pwm
 
Bare metal training_02_le_ds_and_buttons
Bare metal training_02_le_ds_and_buttonsBare metal training_02_le_ds_and_buttons
Bare metal training_02_le_ds_and_buttons
 
Bare metal training_01_hello_world
Bare metal training_01_hello_worldBare metal training_01_hello_world
Bare metal training_01_hello_world
 
Bare metal training_00_prerequisites
Bare metal training_00_prerequisitesBare metal training_00_prerequisites
Bare metal training_00_prerequisites
 
C language lect_23_advanced
C language lect_23_advancedC language lect_23_advanced
C language lect_23_advanced
 
C language lect_22_advanced
C language lect_22_advancedC language lect_22_advanced
C language lect_22_advanced
 
C language lect_21_advanced
C language lect_21_advancedC language lect_21_advanced
C language lect_21_advanced
 
подготовка рабочего окружения
подготовка рабочего окруженияподготовка рабочего окружения
подготовка рабочего окружения
 
C language lect_20_advanced
C language lect_20_advancedC language lect_20_advanced
C language lect_20_advanced
 
C language lect_19_basics
C language lect_19_basicsC language lect_19_basics
C language lect_19_basics
 
C language lect_18_basics
C language lect_18_basicsC language lect_18_basics
C language lect_18_basics
 
C language lect_17_basics
C language lect_17_basicsC language lect_17_basics
C language lect_17_basics
 
C language lect_16_basics
C language lect_16_basicsC language lect_16_basics
C language lect_16_basics
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

Networking essentials lect3

  • 1. 1
  • 2. 2 C/Embedded Base Camp Networking essentials. Lecture 3 Petro Shevchenko Maksym Vysochinenko October 2021
  • 3. 3 1. Transport Layer (L4) 2. UDP Overview 3. TCP Communication Process 4. The Socket API 5. Tools and Utilities Agenda
  • 5. 5 Transport Layer Role of the Transport Layer ● Responsible for establishing a temporary communication session between two applications and delivering data between them. ● Link between the application layer and the lower layers that are responsible for network transmission.
  • 6. 6 Transport Layer Transport Layer Functions ● Data Segmentation ○ The Transport layer divides the data into pieces and adds a header for delivery over the network ● Addressing ○ For addressing at the transport level, ports are used, a number from 1 to 65535. ○ Port numbers are associated with processes on a host and must be unique
  • 7. 7 Transport Layer Socket Pairs • The source and destination ports are placed within the segment. • The segments are then encapsulated within an IP packet. • The combination of the source IP address and source port number, or the destination IP address and destination port number is known as a socket. • Sockets enable multiple processes, running on a client, to distinguish themselves from each other, and multiple connections to a server process to be distinguished from each other.
  • 8. 8 Transport Layer Port Number Groups ▪ Well-known Ports (Numbers 0 to 1023) - These numbers are reserved for services and applications. ▪ Registered Ports (Numbers 1024 to 49151) - These port numbers are assigned by IANA to a requesting entity to use with specific processes or applications. ▪ Dynamic or Private Ports (Numbers 49152 to 65535) - Usually assigned dynamically by the client’s OS and used to identify the client application during communication.
  • 9. 9 Transport Layer Port Number Groups (Cont.) Well Known Port Numbers
  • 10. 10 Transport Layer Transport Layer Reliability ▪ TCP/IP provides two transport layer protocols: • Transmission Control Protocol (TCP) • Considered reliable which ensures that all of the data arrives at the destination. • Additional fields needed in header which increases size and delay. • User Datagram Protocol (UDP) • Does not provide for reliability. • Fewer fields and is faster than TCP.
  • 11. 11 ▪ TCP - databases, web browsers, and email clients require that all data that is sent arrives at the destination in its original condition. ▪ UDP - if one or two segments of a live video stream fail to arrive, if disruption in the stream, may not be noticeable to the user. Transport Layer The Right Transport Layer Protocol for the Right Application
  • 12. 12 User Datagram Protocol (UDP) Overview
  • 13. 13 UDP Overview UDP Features ▪ UDP is a stateless protocol – no tracking ▪ Reliability handled by application
  • 14. 14 UDP Overview UDP Low Overhead versus Reliability ▪ UDP not connection- oriented ▪ No retransmission, sequencing, and flow control ▪ Functions not provided by the transport layer implemented elsewhere
  • 15. 15 UDP Overview UDP Datagram Reassembly UDP: Connectionless and Unreliable ▪ UDP reassembles data in order received and forwards to application ▪ Application must identify the proper sequence
  • 16. 16 UDP Overview UDP Header ● Source Port - This field identifies the sender's port ● Destination Port - This field identifies the receiver's port ● Length - This field specifies the length in bytes of the UDP header and UDP data ● Checksum - The checksum field may be used for error-checking of the header and data
  • 17. 17 UDP Overview Applications that use UDP Three types of applications best suited for UDP: ● Live video and multimedia ● Simple request and reply ● Handle reliability themselves
  • 18. 18 Transmission Control Protocol (TCP) Communication Process
  • 19. 19 TCP Communication Process TCP Reliability- Guaranteed and Ordered Delivery • TCP can also help maintain the flow of packets so that devices do not become overloaded. • There may be times when TCP segments do not arrive at their destination or arrive out of order. • All the data must be received and the data in these segments must be reassembled into the original order. • Sequence numbers are assigned in the header of each packet to achieve this goal.
  • 20. 20 Reliability and Flow Control TCP Flow Control – Maximum Segment Size Maximum Segment Size (MSS) is the maximum amount of data that the destination device can receive. • A common MSS is 1,460 bytes when using IPv4. • A host determines the value of its MSS field by subtracting the IP and TCP headers from the Ethernet maximum transmission unit (MTU), which is 1500 bytes be default. • 1500 minus 40 (20 bytes for the IPv4 header and 20 bytes for the TCP header) leaves 1460 bytes.
  • 21. 21 TCP Communication Process TCP Header Format (RFC 793) Source Port - The source port number (16 bits) Destination Port - The destination port number (16 bits) Sequence Number - The sequence number of the first data octet in this segment (32 bits) Acknowledgment Number - If the ACK control bit is set this field contains the value of the next sequence number the sender of the segment is expecting to receive (32 bits) Data Offset - The number of 32 bit words in the TCP Header. This indicates where the data begins (4 bits) Reserved - Reserved for future use. Must be zero (6 bits)
  • 22. 22 TCP Communication Process TCP Header Format (Cont.) Flags - The six control bit flags are as follows: ● URG: Urgent Pointer field significant ● ACK: Acknowledgment field significant ● PSH: Push Function ● RST: Reset the connection ● SYN: Synchronize sequence numbers ● FIN: No more data from sender Window - The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept (16 bits) Checksum - The header and data checksum (16 bits) Urgent Pointer - The urgent pointer points to the urgent data (16 bits) Options - The Options have variable length data - The segment data have variable length
  • 23. 23 TCP Communication Process TCP Connection Establishment Step 1: The initiating client requests a client-to-server communication session with the server. Step 2: The server acknowledges the client-to-server communication session and requests a server-to-client communication session. Step 3: The initiating client acknowledges the server- to-client communication session. Main tasks: 1 – Synchronize counters SEQ ACK 2 – Define algorithms 3 – Measure RTT – round-trip time >> calculate RTO Retransmission timeout
  • 24. 24 TCP Communication Process Session Termination Step 1: When the client has no more data to send in the stream, it sends a segment with the FIN flag set. Step 2: The server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server. Step 3: The server sends a FIN to the client to terminate the server-to-client session. Step 4: The client responds with an ACK to acknowledge the FIN from the server.
  • 25. 25 TCP Communication Process Sequence Numbers and Acknowledgments
  • 26. 26 TCP Communication Process Window Sliding ● There is two way to send TCP segments: ○ The sender sends one segment and waits for an acknowledgment, after that it sends the next segment ○ The sender sends several segments one-by-one without waiting for an acknowledgment, this is called window sliding ● The internal device buffer can be of limited size, so the window size must not exceed this value ● The sender after sending the data by the window size stops the transmission waiting for an acknowledgment ● After confirming reception, the sender continues to transmit
  • 27. 27 Reliability and Flow Control TCP Reliability – Data Loss and Retransmission No matter how well designed a network is, data loss occasionally occurs. TCP provides methods of managing these segment losses. Among these is a mechanism to retransmit segments for unacknowledged data.
  • 28. 28 Reliability and Flow Control TCP Reliability – Data Loss and Retransmission (Cont.) Host operating systems today typically employ an optional TCP feature called selective acknowledgment (SACK), negotiated during the three-way handshake. If both hosts support SACK, the receiver can explicitly acknowledge which segments (bytes) were received including any discontinuous segments.
  • 29. 29 Reliability and Flow Control TCP Flow Control – Retransmits ▪ Congestion causes retransmission of lost TCP segments ▪ Retransmission of segments can make the congestion worse ▪ To avoid and control congestion, TCP employs several congestion handling mechanisms, timers, and algorithms ▪ Example: Reduce the number of bytes it sends before receiving an acknowledgment ▪ RTO – retransmission timeout
  • 34. 34 Tools and utilities overview ifconfig - configure a network interface nmcli - command-line tool for controlling NetworkManager route - show / manipulate the IP routing table ping - send ICMP ECHO_REQUEST to network hosts traceroute - Trace the route to a host netstat - Print network connections, routing tables, interface statistics dig - DNS lookup utility ncat - Concatenate and redirect sockets nmap - Network exploration tool and security / port scanner tcpdump - dump traffic on a network wireshark - Interactively dump and analyze network traffic
  • 35. 35 NAME ifconfig - configure a network interface SYNOPSIS ifconfig [-v] [-a] [-s] [interface] ifconfig [-v] interface [aftype] options | address ... DESCRIPTION Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
  • 36. 36 NAME nmcli - command-line tool for controlling NetworkManager SYNOPSIS nmcli [OPTIONS...] {help | general | networking | radio | connection | device | agent | monitor} [COMMAND] [ARGUMENTS...] DESCRIPTION nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as a r eplacement for nm-applet or other graphical clients. nmcli is used to create, display, edit, delete, activate, and deactivate network connections, as well as control and display network device status.
  • 37. 37 NAME route - show / manipulate the IP routing table SYNOPSIS route [-CFvnNee] [-A family |-4|-6] route [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] route [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric M] [[dev] If] route [-V] [--version] [-h] [--help]
  • 38. 38 NAME ping - send ICMP ECHO_REQUEST to network hosts SYNOPSIS ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N node info_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop ...] destination DESCRIPTION ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
  • 39. 39 NAME traceroute - Trace the route to a host SYNOPSIS traceroute [OPTION...] HOST DESCRIPTION Print the route packets trace to network host. -f, --first-hop=NUM Set initial hop distance, that is the time-to-live. -g, --gateways=GATES List of gateways for loose source routing. -I, --icmp Use ICMP ECHO as probe.
  • 40. 40 NAME netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships SYNOPSIS netstat [address_family_options] [--tcp|-t] [--udp|-u] [--udplite|-U] [--sctp|-S] [--raw|-w] [--l2cap|-2] [--rfcomm|-f] [--listening|- l] [--all|-a] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [-- timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c] [--wide|-W] netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c]
  • 41. 41 NAME dig - DNS lookup utility SYNOPSIS dig [@server] [-b address] [-c class] [-f filename] [-k filename] [-m] [-p port#] [-q name] [-t type] [-v] [-x addr] [-y [hmac:]name:key] [[-4] | [-6]] [name] [type] [class] [queryopt...] dig [-h] dig [global-queryopt...] [query...] DESCRIPTION dig is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output. Other lookup tools tend to have less functionality than dig.
  • 42. 42 NAME ncat - Concatenate and redirect sockets SYNOPSIS ncat [OPTIONS...] [hostname] [port] DESCRIPTION Ncat is a feature-packed networking utility which reads and writes data across networks from the command line. Ncat was written for the Nmap Project and is the culmination of the currently splintered family of Netcat incarnations. -p, --source-port port Specify source port to use -s, --source addr Specify source address to use (doesn't affect -l) -l, --listen Bind and listen for incoming connections -k, --keep-open Accept multiple connections in listen mode -n, --nodns Do not resolve hostnames via DNS -t, --telnet Answer Telnet negotiations -u, --udp Use UDP instead of default TCP Echo server - ncat -l 12345 -k -c 'xargs -n1 echo' Server Client
  • 43. 43 NAME nmap - Network exploration tool and security / port scanner SYNOPSIS nmap [Scan Type...] [Options] {target specification} DESCRIPTION Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics.
  • 44. 44 NAME tcpdump - dump traffic on a network SYNOPSIS tcpdump [ -AbdDefhHIJKlLnNOpqStuUvxX# ] [ -B buffer_size ] [ -c count ] [ -C file_size ] [ -G rotate_seconds ] [ -F file ] [ -i interface ] [ -j tstamp_type ] [ -m module ] [ -M secret ] DESCRIPTION Tcpdump prints out a description of the contents of packets on a network interface that match the boolean expression; the description is preceded by a time stamp, printed, by default, as hours, minutes, seconds, and fractions of a second since midnight. tcpdump -i eth0 tcpdump host 1.1.1.1 tcpdump port 80 -w capture_file.pcap
  • 45. 45 NAME wireshark - Interactively dump and analyze network traffic SYNOPSIS wireshark [ -a <capture autostop condition> ] ... [ -b <capture ring buffer option> ] ... [ -B <capture buffer size> ] [ -c <capture packet count> ] [ -C <configuration profile> ] DESCRIPTION Wireshark is a GUI network protocol analyzer. It lets you interactively browse packet data from a live network or from a previously saved capture file. Wireshark's native capture file format is pcap format, which is also the format used by tcpdump and various other tools.
  • 46. 46 Homework #2. Preparation to practice 1. Install examples: a. Log into your GitHub account and fork the following repository https://github.com/PetroShevchenko/GL-ESK-ETHERNET b. Clone the repository from your GitHub account into a local repository by running the following command user@host:~$ git clone https://github.com/<githubusername>/GL-ESK-ETHERNET.git 2. Import cloned project into STM32Cube IDE workspace 3. Build the project and upload the firmware to the GL ESK 4. Power off the board then plug-in an Ethernet cable to the board. Power on the board 5. DHCP uses to assign a new IP address of the board. If successful, you will see the assigned IP address on the LCD