TCP and UDP

TCP confirms every piece. UDP just sends

TCP: AGREE FIRST, CONFIRM EVERYTHINGUDP: JUST SENDclientserverclientserverSYN: may I connect?SYN-ACK: yesACK: connecteddataACK: receiveddatadata: lost on the waydataTCP guarantees delivery. UDP trades the guarantee for speed.TCP opens a connection with a three-way handshake, then acknowledges every piece and resendswhat goes missing: web pages, mail, files. UDP sends with no setup and no check: voice, video,DNS lookups and DHCP, where a late packet is worth less than a fast one.

TCP is connection-oriented and reliable. UDP is connectionless and fast.

TCP and UDP · Going deeper

TCP against UDP

TCPUDPConnectionConnection-oriented: handshake firstConnectionless: no setupDeliveryAcknowledged, resent if lost, in orderBest effort: no acknowledgementSpeedSlower: more overheadFaster: less overheadUsed byHTTP, HTTPS, SSH, SMTP, IMAP, RDP, SMBDHCP, TFTP, SNMP, voice and videoBothDNS: UDP for lookups, TCP for large answersConnection-oriented means TCP. Connectionless means UDP.A port number names the service on a host. The IP address finds the host; the port finds the program.

Connection-oriented against connectionless.

Port numbers

Fifteen ports, easier to learn by the job they do

Web80 HTTP443 HTTPSMail25 SMTP · 110 POP3143 IMAPFiles20, 21 FTP445 SMBRemote control22 SSH · 23 Telnet3389 RDPNetwork services53 DNS · 67, 68 DHCP · 389 LDAP161, 162 SNMP · 137 to 139 NetBIOSLearn the ports by the job they do, and the numbers stay put.There are fifteen entries on the A+ list. Group them: two for the web, three for mail, two forfiles, three for remote control, and five that keep the network itself running.

Web 80, 443. Mail 25, 110, 143. Files 20, 21, 445. Remote 22, 23, 3389.

Port numbers · Going deeper · 1 of 2

The port list: 20 to 110

PortProtocolCarried byWhat it does20, 21FTPTCPFile Transfer Protocol: moves files, in clear text22SSHTCPSecure Shell: an encrypted remote command line23TelnetTCPA remote command line in clear text: avoid25SMTPTCPSimple Mail Transfer Protocol: sends mail between servers53DNSTCP, UDPDomain Name System: turns names into addresses67, 68DHCPUDPGives hosts their address settings; server 67, client 6880HTTPTCPWeb pages in clear text110POP3TCPDownloads mail to one deviceEight of the fifteen. The rest are on the next page.

FTP, SSH, Telnet, SMTP, DNS, DHCP, HTTP, POP3.

Port numbers · Going deeper · 2 of 2

The port list: 137 to 3389

PortProtocolCarried byWhat it does137 to 139NetBIOSTCP, UDPOlder Windows naming and sharing, NetBIOS over TCP/IP143IMAPTCPReads mail kept on the server161, 162SNMPUDPMonitors network devices; 162 is for alerts (traps)389LDAPTCPLooks up users and groups in a directory443HTTPSTCPWeb pages encrypted with TLS445SMBTCPWindows file and printer sharing, also called CIFS3389RDPTCPRemote Desktop Protocol: a Windows desktop from afarExpect to match numbers to names in a drag-and-drop question.

NetBIOS, IMAP, SNMP, LDAP, HTTPS, SMB, RDP.

Check yourself

a technician's PCTCP192.168.1.10port 3389

Which service is this traffic for?

Secure protocols

Every clear-text protocol has an encrypted replacement

SENDS IN THE CLEARENCRYPTED REPLACEMENTTelnet · 23the password crosses the network in clear textSSH · 22the same job, encryptedHTTP · 80anyone on the path can read the pageHTTPS · 443HTTP inside TLS encryptionFTP · 20, 21files and login in clear textSFTP · 22file transfer inside SSHEach old protocol has an encrypted replacement. The exam wants the replacement.Telnet, HTTP and FTP send everything, passwords included, as readable text. When a question asksfor the secure way to do the same job, answer SSH, HTTPS or SFTP, and know that the port changes too.

Telnet gives way to SSH, HTTP to HTTPS, and FTP to SFTP.

Secure protocols · Going deeper

Clear and encrypted, job by job

JobIn the clearEncryptedRemote command lineTelnet 23SSH 22WebHTTP 80HTTPS 443File transferFTP 20, 21SFTP 22Reading mailIMAP 143, POP3 110IMAP over TLS 993, POP3 over TLS 995Sending mailSMTP 25Submission with TLS 587Directory lookupsLDAP 389LDAPS 636Remote desktopRDP 3389 is encrypted, but keep it off the open internetIf the scenario mentions passwords, privacy or the internet, pick the encrypted column.

993, 995 and 587 for mail. 636 for LDAPS.

Server roles

Four servers answer before the first file opens

A laptopjoins the network1DHCP: gives it an address2NTP: sets its clock3AAA: checks who the user is4DNS: turns names into addresses5File, print, mail, web: the work itselfBefore a laptop opens one file, four servers have already answered it.Each server has one role. DHCP hands out addresses, NTP keeps clocks agreed, an AAA serverauthenticates the user, and DNS finds everything else by name. A fault in any of them looks, tothe user, like "the network is down".

DHCP addresses, NTP time, AAA sign-in, DNS names, then the work.

Server roles · Going deeper

Server roles

Server roleWhat it providesDNSAnswers "what is the address of this name?"DHCPLeases an IP address, mask, gateway and DNS server to each hostFile share, print serverShared folders, and one queue for each shared printerMail, web, databaseMailboxes; pages over HTTP and HTTPS; stored data for applicationsAAAAuthentication, authorization and accounting: who, what, and a recordNTPNetwork Time Protocol: the same time on every deviceSyslogOne place that collects the logs of many devicesWrong time breaks sign-in: authentication depends on clocks that agree.One machine can hold several roles, and in a small office it usually does.

Syslog collects logs. AAA is who, what, and a record.

Check yourself

A PCstarts up with no network settingsIt sendsa broadcast asking for them, over UDPIt getsan address, a mask, a gateway and a DNS server

Which server answered?

Internet appliances

Boxes with one job, placed where traffic passes

InternetUTMfirewall, antivirus andfiltering in one boxSpam gatewayfilters mailmail serverLoad balancershares out requeststhree web serversusers browsing the webProxy serverfetches pages for usersAn appliance is a box with one network job, placed where the traffic passes.A UTM (unified threat management) device guards the edge. A spam gateway cleans mail beforethe mail server. A load balancer spreads visitors across several servers. A proxy server makesweb requests on behalf of users, so it can filter and cache them.

A UTM guards the edge. Spam gateway, load balancer and proxy each do one job.

Internet appliances · Going deeper · 1 of 2

Legacy, embedded and IoT systems

SystemWhat to knowLegacy systemOld but still needed; often cannot be patched, so isolate itEmbedded systemA computer built into a machine for one jobSCADASupervisory control and data acquisition: runs factories, power, waterIoT deviceInternet of Things: cameras, thermostats, speakers, sensorsRisk they shareWeak or default passwords, rare updates, long livesWhat to doChange defaults, update firmware, put them on their own networkOld and embedded devices stay in service for decades. Protect them by separating them.

SCADA and IoT: change defaults and separate them.

Internet appliances · Going deeper · 2 of 2

Clue words for ports and services

When the question saysThe answer isRemember"connection-oriented", "guaranteed delivery"TCPthree-way handshake"connectionless", "streaming, voice"UDPno acknowledgement"secure remote command line"SSH, port 22not Telnet 23"remote Windows desktop"RDP, port 3389"shared folder on Windows"SMB, port 445CIFS"automatic IP address"DHCP, ports 67 and 68UDP"name to IP address"DNS, port 53TCP and UDP"monitor routers and switches"SNMP, 161 and 162UDP"central user directory"LDAP, port 389"central log collection"Syslog server"spread traffic across servers"Load balancer"one device: firewall, IDS, antivirus"UTMunified threat managementNetworking is 23% of Core 1, and ports are its surest marks.

TCP, UDP, the ports, and the appliances.

Check yourself

Outsidevisitors use one address for the websiteInsidethree web servers take turns answeringIf one failsthe other two carry on

Which appliance is this?

Lesson complete

You finished “Ports, protocols and network services”

Answer the questions along the way to see your score here.

Open in a new tab