Computer Network - Network Applications
Access Network Application Typesβ
C/S Client/Server
P2P Peer-to-Peer Application. Scenario: File sharing. Characteristics: Highly scalable, difficult to manage.
Hybrid Structure: Napster uses P2P for file transfer, C/S for file searching.

Network Application Requirements for Transmission
- Reliability
- Delay
- Bandwidth
- Security



Web: Http 1.0 Http1.1
Email: SMTP MIME POP3 IMAP (IMAP is a stateful protocol)
Domain Name System DNSβ
-
Distributed database composed of multi-layer naming servers
-
Application layer protocol: completes name resolution
-
DNSServicesDomain name translation Host aliasing Mail server aliasing Load balancing
Local DNS (e.g., provided by ISP)
Root DNS
TLD DNS (Authoritative Name Server)
Recursive Query (Only once)
Iterative Query (Multiple times)
Caching, Updating (TTL expiration update)
DNS Records (RR)β
RR format: (name, value, ttl)
- Type=A Name: Host domain name Value: IP address
- Type=NS
Name: Domain (e.g.,
edu.com) Value: Host domain name of the authoritative name server for that domain - Type=
CNAMEName: Alias of a real domain name Value: Real domain name - Type=
MXValue is the mail server corresponding to Name
Q: How to register a domain name?
A: NS, A, NS (requires email) RR
P2P Applicationsβ
Overlay Networkβ
Flooding Query: Overlay Network

Hierarchical Overlay Networkβ

Socket Programmingβ

Identify communication endpoint (External): IP PORT
Handle/Process (Internal): Socket descriptor, is an integer index within the process
# Query which sockets connect to port 80
netstat -ano | findstr ":80"
# Query which program owns the PID
tasklist /FI "PID eq 6016"
tasklist | findstr 6016
Winsocket example
socketaddr_in
socketβ


closesocketβ

bindβ



listen(server)β

connect(client)

If
TCPcalls connect successfully, communication is guaranteed.UDPis not necessarily.
accept(server)β

send sendtoβ

recv recvfromβ

setsockopt getsokopt
Network Byte Orderβ

Inet_addr converts decimal IP address to 32-bit IP address.
Socket API (TCP) Call Basic Processβ

Server: Parse IP, Port, Protocol Number
TCP Client:

UDP Client:

All content comes from sources, course copyright reserved. Document is for learning use only.
If there is any infringement, contact [email protected]
https://www.icourse163.org/learn/HIT-154005?tid=1474180488#/learn/announce
- Attribution: Retain the original author's signature and code source information in the original and derivative code.
- Preserve License: Retain the Apache 2.0 license file in the original and derivative code.
- Attribution: Give appropriate credit, provide a link to the license, and indicate if changes were made.
- NonCommercial: You may not use the material for commercial purposes. For commercial use, please contact the author.
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.