iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

3.4 Network Protocols

Network protocols are the rules by which systems talk. Application protocols (HTTP, SMTP, FTP, SSH) ride on transport (TCP, UDP, QUIC) and are the bread and butter of enterprise integration.

3.4 Network Protocols and Web Services

Application protocols

ProtocolLayerUse
HTTP / HTTPSAppWeb, REST APIs
HTTP/2, HTTP/3AppModern; multiplexed; QUIC for /3
WebSocketAppPersistent bidirectional
SMTP / IMAPAppMail send / receive
FTP / SFTPAppFile transfer (SFTP preferred)
SSHAppRemote shell + tunnels
LDAP / LDAPSAppDirectory queries (AD)
RDPAppRemote desktop
RTP / SRTPAppReal-time audio + video

Web services - four flavours

StyleFormatWhen
SOAPXML envelopesLegacy enterprises; strong contracts
RESTHTTP verbs + JSONDe-facto default
GraphQLSingle endpointClient-shaped queries
gRPCHTTP/2 + protobufHigh-performance polyglot

REST resource design (Sample Bakery Shop)

VerbURLAction
GET/orderslist orders
POST/orderscreate order
GET/orders/{id}read one
PATCH/orders/{id}update fields
DELETE/orders/{id}cancel order
GET/orders/{id}/itemsnested resource

HTTP status codes - the ones to remember

CodeMeaningCodeMeaning
200OK400Bad Request
201Created401Unauthorised
202Accepted403Forbidden
204No Content404Not Found
301Moved Permanently409Conflict
304Not Modified422Unprocessable Entity
500Server Error429Too Many Requests
502Bad Gateway503Service Unavailable

Authentication patterns

PatternUse
BasicUsername:password; HTTPS-only
Bearer (JWT)Signed token in Authorization header
OAuth 2.0Delegated authorisation; cloud apps
mTLSBoth ends present certificates
Mentor’s tip: HTTP and HTTPS are the universal transport. REST + JSON is the common dialect; SOAP, GraphQL, gRPC are domain-specific tools. Standardise on one auth pattern across the enterprise.

Discussion

Loading…