You are on page 1of 7

Implementation of TCP/IP using pSOS

Document By
SANTOSH BHARADWAJ REDDY
Email: help@matlabcodes.com
Engineeringpapers.blogspot.com
More Papers and Presentations available on above site

Abstract - TCP/IP Support - pSOSystem’s underlying network. All common Data Link
TCP/IP networking capabilities are protocols support TCP/IP.
constructed around the pNA+ software
component. pNA+ includes TCP,UDP,IP, Internet Layer - The Internet Layer is
accessed through the industry standard equivalent to the Network Layer in the OSI
socket programming interface. pNA+ offers model. It is responsible for network
services to application developers as well as addressing. The main protocols at this layer
to other pSOSytem networking options such are: Internet Protocol (IP), Address
as RPC,NFS,FTP and so forth. UDP Resolution Protocol (ARP), Reverse Address
provides a datagram mode of packet- Resolution Protocol (RARP), Internet Control
switched communication. It allows users to Message Protocol (ICMP), and Internet Group
send messages with a minimum of protocol Management Protocol (IGMP).
overhead. However, ordered, reliable
The Transport Layer - The Transport Layer is
delivery of data is not guaranteed. The IP
equivalent to the Transport Layer in the OSI
layer is used for transmitting blocks of data
model. The Internet Transport layer is
called datagrams. This layer provides
implemented by TCP and the User Datagram
packet routing, fragmentation and
Protocol (UDP). TCP provides reliable data
reassembly of long datagram through a
transport, while UDP provides unreliable data
network or internet. Multicast IP support is
transport.
implemented in the IP layer. The Network
Interface(NI) layer isolates the IP layer The Application Layer - The Application
from the physical characteristic of the Layer is equivalent to the top three layers,
underlying network medium. It is hardware (Application, Presentation and Session
dependent and is responsible transporting Layers), in the OSI model. The Application
packets within a single network. Because it Layer is responsible for interfacing between
is hardware dependent, the network user applications and the Transport Layer.
interface is not part of pNA+ proper. Applications commonly used are File Transfer
Rather, it is provided by the user, or by ISI Protocol (FTP), Telnet, Simple Network
as a separate piece of software. Management Protocol (SNMP), Domain Name
system (DNS), Simple Mail Transfer Protocol
(SMTP), and so on.
I. INTRODUCTION
pSOS
TCP/IP pSOSystem is a modular, high-performance
Transmission Control Protocol/Internet real-time operating system designed
Protocol (TCP/IP) is not a single protocol; it specifically for microprocessors. It provides a
refers to a family or suite of protocols. The complete multitasking environment based on
suite consists of a four-layer model. open systems standards. pSOSystem is
designed to meet three overriding objectives
Network Interface Layer - The Network (i)Performance, (ii)Reliability,(iii)Ease-of-
Interface Layer is equivalent to the Use. The result is a fast, deterministic, yet
combination of the Physical and Data Link accessible system software solution.
Layers in the OSI model. It is responsible for Accessible in this case translates to a minimal
formatting packets and placing them onto the learning curve. pSOSystem is designed for
quick startup on both custom and commercial
hardware. The pSOSystem software is Call Library. Offers SUN-compatible RPC
supported by an integrated set of cross and XDR services; allows you to build
development tools that can reside on UNIX- or distributed applications using the familiar C
DOS-based computers. These tools can procedure paradigm. 5.pHILE+ File System
communicate with a target over a serial or Manager. Gives efficient access to mass
TCP/IP network connection. storage devices, both local and on a network.
Includes support for CD-ROM devices, MS-
System Architecture DOS compatible floppy disks, and a high-
speed proprietary file system. When used in
The pSOSystem software employs a modular conjunction with the pNA+ component and the
architecture. It is built around the pSOS+ real- pRPC+ subcomponent, offers client-side NFS
time multi-tasking kernel and a collection of services. 6.REPC+ ANSI C Standard
companion software components. Software Library. Provides familiar ANSI C run-time
components are standard building blocks functions such as printf(), scanf(), and so forth,
delivered as absolute position-independent in the target environment.
code modules. They are standard parts in the
sense that they are unchanged from one
application to another. This black box
technique eliminates maintenance by the user
and assures reliability, because hundreds of
applications execute the same, identical code.
Unlike most system software, a software
component is not wired down to a piece of
hardware. It makes no assumptions about the
execution/target environment. Each software
component utilizes a user-supplied
configuration table that contains application
and hardware-related parameters to configure
itself at startup. Every component implements pSOS+ Real-Time Kernel
a logical collection of system calls. To the
application developer, system calls appear as The pSOS+ kernel is a real-time, multitasking
re-entrant C functions callable from an operating system kernel. As such, it acts as a
application. Any combination of components nucleus of supervisory software that Performs
can be incorporated into a system to match services on demand Schedules, manages, and
your real-time design requirements. The allocates resources Generally coordinates
pSOSystem components are listed below. multiple, asynchronous activities. The pSOS+
kernel maintains a highly simplified view of
NOTE: Certain components may not yet be application software, irrespective of the
available on all target processors. Check the application’s inner complexities. To the
release notes to see which pSOSystem pSOS+ kernel, applications consist of three
components are available on your target. classes of program elements (i)Tasks (ii)I/O
1. pSOS+ Real-time Multitasking Kernel. A Device Drivers (iii)Interrupt (iv)Service
field-proven, multitasking kernel that provides Routines(ISRs).
a responsive, efficient mechanism for
coordinating the activities of your real-time Multitasking Implementation - A
system. 2.pSOS+m Multiprocessor multitasked system is dynamic because task
Multitasking Kernel. Extends the pSOS+ switching is driven by temporal events. In a
feature set to operate. Seamlessly across multitasking system, while tasks are internally
multiple, tightly-coupled or distributed synchronous, different tasks can execute
processors. 3.pNA+ TCP/IP Network asynchronously. Figure 2-1 illustrates the
Manager. A complete TCP/IP implementation multitasking kernel. A task can be stopped to
including gateway routing, UDP, ARP, and allow execution to pass to another task at any
ICMP protocols; uses a standard socket time. In a very general way, Figure 2-1
interface that includes stream, datagram, and illustrates multitasking and how it allows
raw sockets. 4.pRPC+ Remote Procedure interrupt handlers to directly trigger tasks that
can trigger other tasks.
C Standard Library specified by the American
National Standards Institute.

Functions Summary
The pREPC+ library provides more than 115
run-time functions. Following the conventions
used in the ANSI X3J11 standard, these
functions can be separated into 4 categories:
1.Character Handling Functions 2.String
Handling Functions 3.General Utilities
4.Input/Output Functions. The Character
Handling Functions provide facilities for
Figure 1 - pSOS Kernel testing characters (for example, is a character a
Thus, a multitasked implementation closely digit?) and mapping characters (for example,
parallels the real world, which is mainly convert an ASCII character from lowercase to
asynchronous and/or cyclical as far as real- uppercase). The String Handling Functions
time systems apply. Application software for perform operations on strings. With these
multitasking systems is likely to be far more functions you can copy one string to another
structured, race-free, maintainable, and re- string, append one string to another string,
usable. Several pSOS+ kernel attributes help compare two strings, and search a string for a
solve the problems inherent in real-time substring. The General Utilities provide a
software development. They include variety of miscellaneous functions including
pSOSystem System Concepts pSOS+ Real- allocating and deallocating memory,
Time Kernel converting strings to numbers, searching and
sorting arrays, and generating random
pREPC+ ANSI C Library numbers.

Most C compilers are delivered with some sort Overview of Networking Facilities in
of run-time library. These run-time libraries pSOS
contain a collection of pre-defined functions
that can be called from your application pSOSystem real-time operating system
program. They are linked with the code you provides an extensive set of networking
develop when you build your application. facilities for addressing a wide range of
However, when you attempt to use these interoperability and distributed computing
libraries in a real-time embedded system, they requirements. These facilities include TCP/IP
encounter one or more of the following Support - pSOSystem’s TCP/IP networking
problems (i) It is the user’s responsibility to capabilities are constructed around the pNA+
integrate library I/O functions into the target software component. pNA+ includes TCP,
environment, a time-consuming task. (ii)The UDP, IP, ICMP, IGMP, and ARP accessed
library functions are not reentrant and through the industry standard socket
therefore do not work in a multitasking programming interface. pNA+ offers services
environment. (iii) The library functions are not to application developers as well as to other
compatible with a published standard, pSOSystem networking options such as RPC,
resulting in application code that is not NFS, FTP, and so forth. PNA+ also works in
portable. conjunction with pSOSystem cross
development tools to provide a network-based
The pREPC+ ANSI C Library solves all of the download and debug environment for single-
above problems. First, it is designed to work or multi-processor target systems.
with the pSOS+ Real-Time Multitasking
Kernel and the pHILE+ file system manager, SNMP — Simple Network Management
so all operating system dependent issues have Protocol, is a standard used for managing
been addressed and resolved. Second, it is TCP/IP networks and network devices.
designed to operate in a multitasking Because of its flexibility and avail-ability,
environment, and finally, it complies with the SNMP has become the most viable way to
manage large, heterogeneous networks The module in pSOS that is used exclusively
containing commercial or custom devices. for networking is pNA+ module. Thus if a
application requires TCP/IP networking this
FTP, Telnet, TFTP — pSOSystem pNA+ module is to be added to the pSOS+
environment includes support for the well kernel. pNA+ is organized into four layers.
known internet protocols File Transfer The Figure below illustrates the architecture
Protocol (FTP) and Telnet (client and server and how the protocols fit into it.
side), and Trivial File Transfer Protocol
(TFTP). FTP client allows you to transfer files
to and from remote systems. FTP server
allows remote users to read and write files
from and to pHILE+ managed devices. Telnet
client enables you to login to remote systems,
while Telnet server offers login capabilities to
the pSOSystem shell, pSH, from remote
systems. TFTP is used in pSOSystem Boot
ROMs and is normally used to boot an
application from a network device.

RPCs — pSOSystem fully supports Sun


Microsystems’ Remote Procedure Call (RPC)
and external Data Representation (XDR)
specifications via the pRPC+ software
component. The pRPC+ component allows
you to construct distributed applications using
the familiar C procedure call paradigm.

NFS — pSOSystem environment offers both Figure 2. pNA+ Architecture


Network File System (NFS) client and NFS
server support. NFS server allows remote The socket layer provides the application
systems to access files stored on pHILE+ programming interface. This layer provides
managed devices. NFS client facilities are part services, callable as re-entrant procedures,
of the pHILE+ component and allow your which your application uses to access internet
application to transparently access files stored protocols; it conforms to industry standard
on remote storage devices. socket syntax and semantics. In addition, this
layer contains enhancements specifically for
embedded real-time applications. The
transport layer supports the two Internet
Transport protocols, Transmission Control
Protocol (TCP) and User Datagram Protocol
(UDP). These protocols provide network
independent transport services. They are built
on top of the Internet Protocol (IP). TCP
provides reliable, full-duplex, task-to-task data
stream connections. It is based on the internet
layer, but adds reliability, flow control,
multiplexing, and connections to the
capabilities provided by the lower layers. UDP
provides a datagram mode of packet-switched
communication. It allows users to send
messages with a minimum of protocol
overhead. However, ordered, reliable delivery
of data is not guaranteed. The IP layer is used
for transmitting blocks of data called
II. pNA+ Software Architecture datagrams. This layer provides packet routing,
fragmentation and reassembly of long
datagrams through a network or internet. BGP neighbors, or peers, are established by
Multicast IP support is implemented in the IP manual configuration between routers to create
layer. a TCP session on port 179. A BGP speaker
will periodically send 19-byte keep-alive
messages to maintain the connection (every 60
seconds by default). Among routing protocols,
III. ALGORITHM BGP is unique in using TCP as its transport
protocol. When BGP is running inside an
BORDER GATEWAY PROTOCOL autonomous system (AS), it is referred to as
The Border Gateway Protocol (BGP) is the Internal BGP (IBGP Interior Border Gateway
core routing protocol of the Internet. It works Protocol). When BGP runs between ASs, it is
by maintaining a table of IP networks or called External BGP (EBGP Exterior Border
'prefixes' which designate network reachability Gateway Protocol). Routers that sit on the
among autonomous systems (AS). It is boundary of one AS, and exchange
described as a path vector protocol. BGP does information with another AS, are called border
not use traditional IGP metrics, but makes or edge routers. In the Cisco operating system,
routing decisions based on path, network IBGP routes have an administrative distance
policies and/or rulesets. Since 1994, version of 200, which is less preferred than either
four of the protocol has been in use on the external BGP or any interior routing protocol.
Internet. All previous versions are now Other router implementations also prefer
obsolete. The major enhancement in version 4 eBGP to IGPs, and IGPs to iBGP.
was support of Classless Inter-Domain
Optional Extensions negotiated at
Routing and use of route aggregation to
decrease the size of routing tables. From Connection Setup
January 2006, version 4 is codified in RFC During the OPEN handshake, BGP speakers
4271, which went through well over 20 drafts can negotiate[1] optional capabilities of the
from the earlier RFC 1771 version 4. The RFC session, including multiprotocol extensions
4271 version corrected a number of errors, and various recovery modes. If the
clarified ambiguities, and also brought the multiprotocol extensions to BGP [2] are
RFC much closer to industry practices. BGP negotiated at the time of creation, the BGP
was created to replace the EGP routing speaker can prefix the Network Layer
protocol to allow fully decentralized routing in Reachability Information (NLRI) it advertises
order to allow the removal of the NSFNet with an address family prefix. These families
Internet backbone network. This allowed the include the default IPv4, but also IPv6, IPv4
Internet to become a truly decentralized and IPv6 Virtual Private Networks, and
system. multicast BGP. Increasingly, BGP is used as a
Very large private IP networks can also make generalized signaling protocol to carry
use of BGP. An example would be the joining information about routes that may not be part
of a number of large Open Shortest Path First of the global Internet, such as VPNs [3].
(OSPF) networks where OSPF by itself would Finite state machine
not scale to size. Another reason to use BGP
would be multihoming a network for better
redundancy either to a multiple access points
of a single ISP (RFC 1998) or to multiple
ISPs. Most Internet users do not use BGP
directly. However, since most Internet service
providers must use BGP to establish routing
between one another (especially if they are
multihomed), it is one of the most important
protocols of the Internet. Compare this with
Signaling System 7 (SS7), which is the inter-
provider core call setup protocol on the PSTN.

BGP operation
In order to make decisions in its operations out at the same time. Modern RIP
with other BGP peers, a BGP peer uses a implementations introduce deliberate time
simple finite state machine that consists of six variation into the update timer of each router.
states: Idle, Connect, Active, OpenSent, It runs at the network layer of the Internet
OpenConfirm, and Established. For each peer- protocol suite. RIP prevents routing loops
to-peer session, a BGP implementation from continuing indefinitely by implementing
maintains a state variable that tracks which of a limit on the number of hops allowed in a
these six states the session is in. The BGP path from the source to a destination. This hop
protocol defines the messages that each peer limit, however, limits the size of networks that
should exchange in order to change the session RIP can support. RIP implements the split
from one state to another. The first mode is the horizon and hold down mechanisms to prevent
“Idle” mode. In this mode BGP initializes all incorrect routing information from being
resources, refuses all inbound BGP connection propagated. These are some of the stability
attempts, and initiates a TCP connection to the features of RIP. In many current networking
peer. The second state is “Connect”. In this environments RIP would not be the first
state the router waits for the TCP connection choice for routing as its convergence times and
to complete, transitioning to the "OpenSent" scalability are poor compared to EIGRP,
state if successful. If not, it resets the OSPF, or IS-IS (the latter two being link-state
ConnectRetry timer and transitions to the routing protocols), and the hop limit severely
"Active" state upon expiration. In the "Active" limits the size of network it can be used in. On
state, the router resets the ConnectRetry timer the other hand, it is easier to configure
to zero, and returns to the "Connect" state. because, using minimal settings for any
After "OpenSent," the router sends an Open routing protocols, RIP does not require any
message, and waits for one in return. parameter on a router whereas all the other
Keepalive messages are exchanged next, and protocols require at least one or more
upon successful receipt, the router is placed in parameters. Architecturally, RIP is a layer
the “Established” state. Once established the management protocol for what is called the
router can now send/receive Keepalive, Internetwork Layer in the Internet protocol
Update, and Notification messages to/from its suite or the Network Layer in the OSI
peer. Reference Model. While it is carried in end-to-
end (IPS) or transport layer (OSI) packets,
ROUTING INFORMATION using port number 520 in the User Datagram
ROTOCOL Protocol (UDP), as a routing protocol, it
belongs to the network layer, not the layer that
RIP is a distance-vector routing protocol, moves its packets.
which employs the hop count as a routing
metric. The maximum number of hops allowed
with RIP is 15, and the hold down time is 180
seconds. Originally each RIP router transmits IV.CONCLUSION
full updates every 30 seconds by default.
Originally, routing tables were small enough The project entitled “Network
that the traffic was not significant. As Communication using pSOS” was successfully
networks grew in size, however, it became completed and the required reports were
evident there could be a massive burst every generated. It has been designed to cater the
30 seconds, even if the routers had been needs of the organization. The system is
initialized at random times. It was thought, as extremely user friendly. Appropriate help is
a result of random initialization, the routing provided whenever necessary. The system is
updates would spread out in time, but this was developed in Client/Server model and the
not true in practice. Sally Floyd and Van system is tested with both live and sample
Jacobson published research in 1994 [1] that data. The results of the live data is compacted
showed having all routers use a fixed 30 with the actual system and verified for its
second timer was a very bad idea. Without accuracy. The system is flexible so that there
slight randomization of the update timer, this is a lot of scope to update the system. As the
research showed that the timers weakly system is flexible, the system can be changed
synchronized over time and sent their updates if any changes come in future. The system is
portable. Thus, the developed system has been
completed customized for the satisfaction of
the users.

V.REFERENCES Document By
SANTOSH BHARADWAJ REDDY
[1] Jiantao Wang, Lun Li, Steven H.Low and Email: help@matlabcodes.com
John C.Doyle: “Cross-Layer Optimization in
TCP/IP networks,” IEEE/ACM TRANS. ON Engineeringpapers.blo
NETWORKING, 13(3):582-568, JUNE 2005. gspot.com
[2] Mark Bernett and Gene Oleynik: “Uniform More Papers and
communication software using TCP/IP,” Presentations
IEEE/ACM TRANS. ON NETWORKING,
MAY 1999. available on above
[3] J.Borje, H.A Lund: ”Real Time Routers for
site
Wireless Networks,” IEEE TRANS. REAL
TIME, SEP 2003.

[4]Steven H. Low: “A duality model of TCP


and queue management algorithms,”
IEEE/ACM TRANS. On Networking,
11(4):525-536,August 2003.

[5]Jiantao Wang, Lun Li, Steven H. Low , and


John C. Doyle. Can TCP and shortest-path
routing maximize utility? In Proc. Of IEEE
Infocom, April 2003.

[6]Frank P. Kelly, Aman Maulloo, and


David Tan. Rate control for
communication networks: Shadow prices,
proportional fairness and stability. Journal
of Operations Research Society,
49(3):237-252, March 1999.
[7] Behrouz A.Forouzan: “TCP/IP
Protocol Suite”.