Skip to main content

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.

20250920190143

Network Application Requirements for Transmission

  • Reliability
  • Delay
  • Bandwidth
  • Security

20250920190156


20250920190215

20250920190229

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

  • DNS Services

    Domain 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=CNAME Name: Alias of a real domain name Value: Real domain name
  • Type=MX Value 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

20250920190253

Hierarchical Overlay Network​

20250920190303

Socket Programming​

20250920190342

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​

20250920190400

20250920190426

closesocket​

20250920190436

bind​

20250920190509

20250920190649

20250920190703

listen(server)​

20250920190720

connect(client)

20250920190743

If TCP calls connect successfully, communication is guaranteed. UDP is not necessarily.

accept(server)​

20250920190805

send sendto​

20250920190820

recv recvfrom​

20250920190831

setsockopt getsokopt

Network Byte Order​

20250920190916

Inet_addr converts decimal IP address to 32-bit IP address.

Socket API (TCP) Call Basic Process​

20250920190932

Server: Parse IP, Port, Protocol Number

TCP Client:

20250920190945

UDP Client:

20250920190959

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

Agreement
The code part of this work is licensed under Apache License 2.0 . You may freely modify and redistribute the code, and use it for commercial purposes, provided that you comply with the license. However, you are required to:
  • 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.
The documentation part of this work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License . You may freely share, including copying and distributing this work in any medium or format, and freely adapt, remix, transform, and build upon the material. However, you are required to:
  • 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.