Exploring the Transport Layer
The Transmission Control Protocol (TCP) over IP protocol (TCP/IP) protocol suite has four layers: link, network, transport and application layers. TCP and User Datagram Protocols (UDP) operate at the transport layer and TCP is connection oriented and ensures data delivery while UDP is connectionless and has no mechanism to check data delivery.
In the “three way handshake” in TCP, the sender/client sends a connection request to the server using a SYN (synchronization) message (a bit flag in the TCP header sent with an initial sequence number and the maximum transmission size (MTU)). On receipt of the SYN message, the reply message from the server contains the sequence number and the SYN and ACK bits set. The client then sends an ACK and the sequence number incremented by one to confirm connection setup. With UDP data is sent with no connection set up.
Routing
A switch is a layer two device with physical ports which communicates using frames at layer one while a router is a layer three device which communicates with packets encapsulated within a frame. The network medium determines the router interface used to connect to the network i.e. Ethernet interface, token ring interface etc. The router’s main role is to identify the best network path in a complex network by using routing algorithms and routing protocols and also to transmit information about the network
Routing Protocols
Routing protocols use algorithms to identify the best path through internetworks. Routing and routed protocols are network layer entities and the routing protocols provide information for the routing tables (network state updates) while a routed protocol enters a router interface and is forwarded out of another interface based on information in the routing table. IP is the most popular routed protocol and IP datagrams are handed off by routers, hop-by-hop to route them to their final destination.
Understanding Networking
The OSI (Open Systems Interconnect) Reference model has seven layers and was designed to provide continuity across multi-vendor hardware and software applications. The application layer is what the user sees e.g. the browser or mail reader, the presentation layer handles data formatting and syntax in the application layer while the session layer handles authentication and authorization, managing and terminating connections. The transport layer has functionality for communication across platforms and the network layer is the routing layer and enables delivery of data to the transport layer. The data link layer allows the signal to get from the computer to the network while the physical layer is the actual cable leaving the hardware.
Quick Tutorial on the OSI and TCP/IP Model
Communication protocols are the rules governing information exchange in a network and determine peer process communication. The OSI model is an ISO (International Organization for Standardization) standard defining a seven layer networking framework for implementing protocols . Each layer handles specific and basic functions and at each layer, data exists in Protocol Data Units (PDUs). Details of the OSI layer are summarized in 4.0. The TCP/IP model was developed to create a resilient network under any conditions and has only four layers with the OSI application, presentation and session layers combined into one layer (Application) and the OSI data link and physical layers combined into another layer (Network Access), resulting in Application, Transport, Internet and Network Access layers.
The Cisco three layer model (hierarchical inter-networking model), simplifies building a reliable, scalable and cheaper hierarchical internetwork by focusing on three layers of the network: core which includes high–end switches and high speed cables, distribution (work group layer) which includes layer 3 switches and LAN based routers and access (desktop layer) includes hubs/switches focused on connecting client nodes. This model provides high performance, efficient management/troubleshooting, easy policy creation and scalability.
The type of sockets (TCP, UDP or a mix) used when programming a network game depends on the type of game. TCP is reliable and ordered while UDP is unreliable with no guarantee of ordering. For games with a real time requirement, TCP is not recommended because it first breaks up the data stream into packets before transmission and may wait for a reasonably sized packet before transmitting which will delay game updates. Also whenever packets are lost, TCP resends them so the receiver node waits to receive lost packets before processing subsequent packets, affecting the user experience. Using both TCP and UDP is also not recommended as this is complex and TCP induces packet loss in UDP packets when used together, hence for games with a real time requirement, UDP is recommended .
Conclusion
Review of the various sites has enabled me to gain a clearer understanding of the transport and network layer functions, how they operate and the advantages and differences of the different layered models.
Works Cited
Fielder, Glenn. UDP vs TCP. 2013. 07 03 2016. <http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/>.
Norton, Michael. Networking as a 2nd Language - Exploring the Transport Layer. 13 07 2001. Web. 07 03 2016. <http://archive.oreilly.com/pub/a/network/2001/07/13/net_2nd_lang.html>.
—. Networking as a 2nd Language - Exploring the Transport Layer (page 2). 13 07 2001. 07 03 2016. <http://archive.oreilly.com/pub/a/network/2001/07/13/net_2nd_lang.html?page=2&x-prder=date>.
—. Networking as a 2nd Language - Layer 3 Switching -- Introducing the Router. 13 04 2001. 07 03 2016. <http://archive.oreilly.com/pub/a/network/2001/04/13/net_2nd_lang.html>.
—. Networking as a 2nd Language - The Scholar's Approach to the Internet. 09 02 2001. Web. 07 03 2016. <http://archive.oreilly.com/pub/a/network/2001/02/09/net_2nd_lang.html>.
—. Networking as a 2nd Language - Understanding Routing Protocols. 22 05 2001. Web. 07 03 2016. <http://archive.oreilly.com/pub/a/network/2001/05/22/net_2nd_lang.html>.
OSI & TCP IP Tutorial. 2009. 07 03 2016. <http://semsim.com/ccna/tutorial/osi/osi.html>.
Parziale, Lydia, et al. "TCP/IP Tutorial and Technical Overview." 12 2006. IBM Redbooks. Document. 08 03 2016. <https://www.redbooks.ibm.com/redbooks/pdfs/gg243376.pdf>.