Jump to content

Computer network programming: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Undid revision 774667616 by 2602:30A:C7DA:D040:D58E:5C3C:9571:B9B2 (talk)
m treated abbreviations according to guidelines; added internal links with Connection-oriented_communication & Connectionless_communication & Communications_protocol and more
Line 5: Line 5:
== Connection-oriented and connectionless communications ==
== Connection-oriented and connectionless communications ==


Very generally, most of communications can be divided into connection-oriented, and connectionless. Whether a communication is a connection-oriented, or connectionless, is defined by the communication protocol, and not by [[Application_programming_interface|API]]. Examples of the connection-oriented protocols include TCP and SPX, and examples of connectionless protocols include UDP, "raw IP", and IPX
Very generally, most of communications can be divided into [[Connection-oriented_communication|connection-oriented]], and [[Connectionless_communication|connectionless]]. Whether a communication is a connection-oriented, or connectionless, is defined by the [[Communications_protocol|communication protocol]], and not by {{nowr|[[Application_programming_interface|application programming interface]] (API)}}. Examples of the connection-oriented protocols include {{nowr|[[Transmission_Control_Protocol|Transmission Control Protocol]] (TCP)}} and {{nowr|[[Sequenced_Packet_Exchange|Sequenced Packet Exchange]] (SPX)}}, and examples of connectionless protocols include {{nowr|[[User_Datagram_Protocol|User Datagram Protocol]] (UDP)}}, "raw IP", and {{nowr|[[Internetwork_Packet_Exchange|Internetwork Packet Exchange]] (IPX)}}.


== Clients and servers ==
== Clients and servers ==
{{main|client–server model}}
{{main|client–server model}}


For connection-oriented communications, communication parties usually have different roles. One party is usually waiting for incoming connections; this party is usually referred to as "server". Another party is the one which initiates connection; this party is usually referred to as "client".
For connection-oriented communications, communication parties usually have different roles. One party is usually waiting for incoming connections; this party is usually referred to as "[[Server_(computing)|server]]". Another party is the one which initiates connection; this party is usually referred to as "[[Client_(computing)|client]]".


For connectionless communications, one party ("server") is usually waiting for an incoming packet, and another party ("client") is usually understood as the one which sends an unsolicited packet to "server".
For connectionless communications, one party ("server") is usually waiting for an incoming packet, and another party ("client") is usually understood as the one which sends an unsolicited [[Network_packet|packet]] to "server".


== Popular protocols and APIs ==
== Popular protocols and APIs ==


Network programming traditionally covers different layers of OSI/ISO model (most of application-level programming belongs to L4 and up). The table below contains some examples of popular protocols belonging to different OSI/ISO layers, and popular APIs for them.
Network programming traditionally covers different layers of [[OSI_model|OSI/ISO model]] (most of application-level programming belongs to L4 and up). The table below contains some examples of popular protocols belonging to different OSI/ISO layers, and popular APIs for them.


{| class="wikitable"
{| class="wikitable"

Revision as of 18:27, 11 April 2017

Computer network programming involves writing computer programs that enable processes to communicate with each other across a computer network.

Connection-oriented and connectionless communications

Very generally, most of communications can be divided into connection-oriented, and connectionless. Whether a communication is a connection-oriented, or connectionless, is defined by the communication protocol, and not by application programming interface (API). Examples of the connection-oriented protocols include Transmission Control Protocol (TCP) and Sequenced Packet Exchange (SPX), and examples of connectionless protocols include User Datagram Protocol (UDP), "raw IP", and Internetwork Packet Exchange (IPX).

Clients and servers

For connection-oriented communications, communication parties usually have different roles. One party is usually waiting for incoming connections; this party is usually referred to as "server". Another party is the one which initiates connection; this party is usually referred to as "client".

For connectionless communications, one party ("server") is usually waiting for an incoming packet, and another party ("client") is usually understood as the one which sends an unsolicited packet to "server".

Network programming traditionally covers different layers of OSI/ISO model (most of application-level programming belongs to L4 and up). The table below contains some examples of popular protocols belonging to different OSI/ISO layers, and popular APIs for them.

OSI/ISO Layer Protocol API
L3 (network) IP Raw socket
L4 (transport) TCP, UDP, SCTP Berkeley Sockets
L5 (session) TLS OpenSSL
L7 (application) HTTP Various

References

  • W. Richard Stevens: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X