<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5759285407797891098</id><updated>2011-07-28T09:07:34.875-07:00</updated><category term='gateway device'/><category term='network lab'/><category term='fifo'/><category term='win98'/><category term='6th sem oslab'/><category term='Sygate Single NIC Gateway'/><category term='install dedicated pc'/><category term='Netgear ME102 Wireless Access Point'/><category term='device'/><category term='Using e-smith Internet Gateway on the NTL Cable Modem Service'/><category term='osandnetworklab'/><category term='os lab'/><category term='pipe'/><category term='ICS'/><category term='Connecting an Xbox to Your Cable Connection'/><category term='6th sem cslab'/><category term='VoIP'/><category term='shared memory'/><category term='my unbuntu'/><category term='pc to gateway'/><category term='networklab'/><category term='cm'/><category term='oslab'/><category term='os and network lab'/><category term='network'/><category term='Windows 2000 and ICS'/><category term='Windows XP and ICS'/><category term='The Linksys BEFSR41 Etherfast Cable/DSL Router'/><title type='text'>OS and Network Lab Programs</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-1941307407770000457</id><published>2008-10-31T08:21:00.002-07:00</published><updated>2008-10-31T08:25:50.895-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='VoIP'/><title type='text'>Network Lab: VoIP</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;VoIP&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt; VoIP, or Voice Over IP to give it it's full name, is basically telephony services over the public Internet using TCP/IP. A conventional telephone will have a wired connection to a local telephone switch and will generate a switched connection over the public telephone network. In a VoIP connection, the connection is converted to TCP/IP and then made across the Internet.&lt;p&gt; VoIP can be used just like a conventional telephone service, so it can be used to connect to other VoIP phones, conventional phones on the PSTN, or POTS (Plain Old Telephone Service), and Mobiles, as shown below. VoIP telephones can be physical phones, that look just like conventional telephones, or they can be 'soft' phones that reside as software on a PC. The PC used in this way requires a sound card with speakers and a microphone, which can be in the form of a headset or VoIP telephone connected to a soundcard or via USB.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/voip_conn.gif" alt="VoIP Connectivity" align="middle" border="0" height="361" width="607" /&gt;&lt;/div&gt;&lt;p&gt; One huge benefit VoIP provides is that for some connections there is no cost for calls made. These connections are normally those made to the same network, i.e., another user of the same VoIP service as the originator with call charges incurred when crossing to other networks such as the PSTN or Mobile networks. Charges may also be incurred when connected from one VoIP provider to another. Typically providers will offer quantities of times for monthly fees, in much the same way as fixed fee mobile phone contracts.&lt;/p&gt;&lt;p&gt; Although VoIP has been around for a few years with products such as NetMeeting or MSN, where the remote user had to have the same application as the caller had, there are still issues concerning implementations of the services available which can result in incompatibilties between some providers implementations of VoIP services. The IETF (Internet Engineering Task Force) has been involved in developing a standard for VoIP called SIP (Session Initiated Protocol), which is becoming the accepted protocol for Internet telephony.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;VoIP Providers&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  SIP-based providers:  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.sipgate.co.uk/"&gt;Sipgate&lt;/a&gt;&lt;p&gt;  Provides a geographical telephone number based on conventional UK dialling codes.  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.voiptalk.co.uk/"&gt;Voiptalk&lt;/a&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.vonage.co.uk/"&gt;Vonage&lt;/a&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.call1899.co.uk/voip.php"&gt;Call 1899&lt;/a&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.globalvillage.com/uk/home.html"&gt;Global Village&lt;/a&gt;&lt;p&gt;  Requires a Zoom Router or ATA to operate! &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;  Non SIP Providers:  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.skype.com/"&gt;Skype&lt;/a&gt;&lt;p&gt;  Skype is an extremely popular VoIP service that uses a proprietry protocol based around P2P technology.  &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;b&gt;VoIP Hardware&lt;/b&gt;&lt;p&gt; VoIP is an extremely versatile application. It can be used via an application on a PC, thru' a VoIP phone, or even a conventional telephone connected either to a SIP-enabled router or an Analogue Telephone Adapter, or ATA. Some routers are also available that provide an RJ11 socket so that a conventional phone can be connected directly to the router, although an adapter may also need to be used if the telephone has a standard 'BT' or RJ12 plug. Some of these hardware solutions are shown in the diag below.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/voip_lan.gif" alt="" align="" border="0" height="248" width="607" /&gt;&lt;/div&gt;&lt;p&gt;  If you are a Skype user it is possible to obtain phones and routers that are compatible with the Skype service.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;VoIP Software&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Some VoIP providers supply their own software (Skype especially, as their software is proprietry) but one application that is often recommended is &lt;a href="http://www.xten.com/index.php?menu=products&amp;amp;smenu=download"&gt;X-Lite&lt;/a&gt;.&lt;/p&gt;&lt;p&gt; X-Lite can be at first look complicated to set-up due to the number of options but in reality there are only two areas of configuration that are need to be set up. These are the Network and SIP Proxy setups. The following screendumps show these areas and the settings that are required. The screendumps are for a Sipgate account.&lt;/p&gt;&lt;p&gt;  X-Lite Network Setup&lt;/p&gt;&lt;p&gt; Most of the settings on this page can be left at default with just the Firewall IP address being set. Note, this will need to be set to the IP address of the local Network gateway, not the address shown here:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/x-litenetwork.gif" alt="" border="0" height="332" width="552" /&gt;&lt;/div&gt;&lt;p&gt;  X-Lite SIP Proxy Setup&lt;/p&gt;&lt;p&gt; This screen should reflect the settings required to connect to the VoIP provider. Again, the details shown are for a Sipgate account. The appropriate information will need to be entered for the VoIP provider being used.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/x-liteproxysetup.gif" alt="" border="0" height="333" width="586" /&gt;&lt;/div&gt;&lt;p&gt;  &lt;b&gt;VoIP and Firewalls&lt;/b&gt;&lt;/p&gt;&lt;p&gt; NAT and software firewalls can cause some disruption to VoIP due to the number of ports that some software requires. Simple NAT found on most domestic Routers does not really cause much disruption but more intelligent security may require some incoming ports to be forwarded to the PC running the software. In some extreme cases, it may be necessary to place the PC as a DMZ host however the risk of doing this cannot be underestimated. If a software firewall is used on a PC, then it may be necessary to configure some rules on that in order to allow VoIP services.&lt;/p&gt;&lt;p&gt; The Skype client generates a random port for it's communication when it is installed and this port may need to be forwarded thru' any firewalls. X-Lite, OTOH, utilizes a number of ports for the SIP (UDP 5060) protocol as well as for the RTP (udp 8000) and RTCP (UDP 8001) protocols used for transporting the audio and video over the network and again, these may need to be forwarded thru' any firewalls or NAT devices that are installed. Other ports above 8001 may also be required.&lt;/p&gt;&lt;p&gt; Additionally, if a STUN (Simple Traversal of UDP Through NAT) server is used there may also be a need to allow the ports necessary for this service as well, these being UDP and TCP port 3478, although some providers such as Sipgate run their STUN server on UDP port 10000. The purpose of a STUN server is to allow STUN aware clients to determine the ports used by the NAT device that it resides behind as well as the type of NAT that is in use by that device.&lt;/p&gt;&lt;p&gt;   &lt;b&gt;Further Reading&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.voip-info.org/tiki-index.php"&gt;Voip-Info.org&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.voip.org.uk/"&gt;Voip.org.uk&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.voipuser.org/index.php"&gt;Voipuser.org&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.fcc.gov/voip/"&gt;Fcc.gov&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-1941307407770000457?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/1941307407770000457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=1941307407770000457' title='42 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/1941307407770000457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/1941307407770000457'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-voip.html' title='Network Lab: VoIP'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>42</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-5048577229119039566</id><published>2008-10-31T08:21:00.000-07:00</published><updated>2008-10-31T08:25:07.422-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='Connecting an Xbox to Your Cable Connection'/><title type='text'>Network Lab: Connecting an Xbox to Your Cable Connection</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Connecting an Xbox to Your Cable Connection&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt;  &lt;table&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xboxconsole.jpg" alt="Xbox Console" border="0" height="174" width="290" /&gt;&lt;/td&gt;   &lt;td&gt;Microsoft's Xbox system is an awesome games console in it's own right but hook it up to your Network via it's inbuilt    network interface and you too can have fun beating up or shooting folks from anywhere, or maybe just outbraking them into the    Goddards hairpin at Donnington. All from the comfort of your own home:-)&lt;p&gt; Ordinarily, a subscription to Microsoft's XBox-Live service is required for on-line gaming with the XBox, but it is possible to use third party systems such as XBConnect and Gamespy, both of which require another PC to be on the same network as the XBox which then, in effect, becomes a proxy for the XBox.&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;h2&gt;The Physical Connection&lt;/h2&gt;&lt;p&gt;    But enough of frivolities. Before we can do any of the above your Xbox needs to be connected to either your Cable Modem or    your network. The network interface on the Xbox is a conventional DTE 10BaseT interface so can be connected to your   broadband network in the same manner as any PC. In other words, a straight CAT5 cable is normally all that is required,    although if you are just connecting to a NIC on a PC, then a x-over cable will be necessary. The following diagrams show    scenarios for Xboxes where either a straight cable is needed or a x-over cable is necessary.&lt;/p&gt;&lt;p&gt;      Scenarios where a straight cable is required to connect an Xbox include connecting direct to external Cable Modems,    connecting to Routers and connecting to Hubs:&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xboxstraight.gif" alt="Xbox Console" border="0" height="325" width="591" /&gt;   &lt;/div&gt;&lt;p&gt;      Scenarios where a x-over cable are required include connecting to some Set Top Boxes (this is usually indicated near the   connector on the STB) and where a PC is used as a Gateway machine and no hub or switch is used in the network:&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xboxcrossover.gif" alt="Xbox Console" border="0" height="269" width="591" /&gt;   &lt;/div&gt;&lt;p&gt;      It is also possible to use a wireless connection with an XBox through the use of an Ethernet/802.11x adapter such as an SMC   SMC2670W Ethernet/Wireless Adapter or Linksys WET11. This would then allow your XBox to use your existing Wireless    Network.&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;h2&gt;MAC Addressing&lt;/h2&gt;&lt;p&gt;      If your XBox is connected directly to a Cable Modem or STB there is a need for the Cable Modem or STB to know the MAC    address of the Xbox. The MAC address of a device is a 12 digit hexadecimal number that is unique to each ethernet device and    NTL configure their cable modems and STBs to only connect to devices whose MAC addresses are known. With an Cable    Modem there is a maximum number of two MAC addresses that the Modem can talk to, whereas with an STB the maximum    number is five.&lt;/p&gt;&lt;p&gt; With an external Modem, all that is needed to connect an XBox to the modem is that the Modem and PC require switching off and the RJ45 cable removed from the PC and then connected to the XBox. Once done, switch on the Cable Modem and wait for it to synchronize with the Head-end. Finally, switch the XBox on and assuming that your XBox Live set-up is for DHCP, it will obtain an IP address from NTL.&lt;/p&gt;&lt;p&gt;      For an STB, you need to configure the MAC address of the XBox via the 'start.ntl' URL, where the MAC can be registered as a    device.&lt;/p&gt;&lt;p&gt; It is also possible to clone the MAC address of an exisiting cable connected device via the XBox Live set-up, which will allow use of the XBox without having to switch off modems or add MAC addresses to the STB.&lt;/p&gt;&lt;p&gt;      Note: If your XBox resides on your LAN, behind a router or Gateway PC, then the MAC address issues discussed above   are irrelevant!&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;h2&gt;IP Addressing&lt;/h2&gt;&lt;p&gt; More often than not your XBox will just need to use DHCP in order to get an address (this is most important when connecting direct to a Cable Modem or STB) but in the instance where a DHCP server is not available, it is possible to set a fixed IP Address via the Xbox Live set-up. This address must be compatible with your existing IP Network addressing and the XBox's default gateway needs to be set as your network's gateway address.&lt;/p&gt;&lt;p&gt;       For example, consider a network with a couple of PCs behind a Linksys Router. By default, the Linksys Router will have an    address of 192.168.1.1, and the PCs, if using DHCP, will have 192.168.1.100 and 192.168.1.101 respectively. In this scenario,    the XBox would get an address via DHCP but if there was a decision to fix it's address, then it also would need an address on    the 192.168.1.x network and it's default gateway would be 192.168.1.1. When setting the address on the XBox be aware of    existing addreses on the network and avoid use of addresses in any DHCP range used. For the Linksys in our example, this    would mean addresses 192.168.1.100 to 192.168.1.149, inclusive.&lt;/p&gt;&lt;p&gt;      &lt;/p&gt;&lt;h2&gt;Some XBox Links&lt;/h2&gt;&lt;p&gt;      &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.xbox.com/"&gt;The Official MS XBox Site&lt;/a&gt;&lt;p&gt;   &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.xboxfaq.info/"&gt;The Unofficial XBox FAQ&lt;/a&gt;&lt;p&gt;   &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.xbox365.com/"&gt;Xbox 365&lt;/a&gt;&lt;p&gt;   &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.xboxaddict.com/"&gt;X-Box Addict&lt;/a&gt;&lt;p&gt;   &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.teamxbox.com/"&gt;Team Xbox&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-5048577229119039566?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/5048577229119039566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=5048577229119039566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5048577229119039566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5048577229119039566'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-connecting-xbox-to-your.html' title='Network Lab: Connecting an Xbox to Your Cable Connection'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-4090958202448642530</id><published>2008-10-31T08:19:00.000-07:00</published><updated>2008-10-31T08:21:25.714-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Netgear ME102 Wireless Access Point'/><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><title type='text'>Network Lab: Netgear ME102 Wireless Access Point</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Netgear ME102 Wireless Access Point&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt;  &lt;table&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102.jpg" alt="Netgear ME102 AP" border="0" height="161" width="283" /&gt;&lt;/td&gt;   &lt;td&gt;Netgear's ME102 802.11b Access Point is a fairly innocuous piece of kit, it being a small Netgear-blue slab with a couple of small LEDs on the the top to show that both power is on and that the wireless service is available. It also features a couple of small antenna. The rear of the unit has sockets for power, an ethernet connection and a USB port for access to the AP's management console.&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;  &lt;b&gt;Basic Setup of the ME102&lt;/b&gt;&lt;/p&gt;&lt;p&gt; The ME102 acts as a MAC-level bridge. What this means is that it does not have any concept of TCP/IP or any applications running over TCP/IP so when connected to a network, any devices that connect via wireless can communicate directly with that network, assuming the TCP/IP settings are correct. If there is a DHCP server on the network then any wireless clients will be able to get an IP address from that server, via the ME102. Because of this, the only set-up required for the ME102 to work is to plug in the power supply and connect the ethernet connection to the network using a straight RJ45 cable (supplied with the unit). In order to manage or monitor the ME102, however, it is necessary to use the supplied management software. Two versions are supplied, one that connects via USB to the console and one that can be used across the local network.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Accessing the ME102 USB Management Console&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Before considering managing the AP, the necessary connections need to be made. The following diagram shows the ME102 in a typical network where it has a connection to the Router/switch via Ethernet and a connection via USB to one of the networked PCs. Note that the USB connection does not have be permanantly connected for the ME102 to function, nor does it need to be on a separate PC.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102net.gif" alt="ME102 Management" border="0" height="300" width="600" /&gt;&lt;/center&gt;&lt;p&gt; The simplest method for accessing the ME102 console is to connect a PC via the USB port. Windows will recognize the ME102 as a new device and will install the necessary drivers. Once that is completed, the USBManager software needs to be installed. On running, the Manager displays a panel showing the both AP's and management utility version numbers. Two buttons are available, Configure and Exit. Clicking Configure shows the AP USB Management Screen, General Configuration.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102gen.gif" alt="USB Manager - General" border="0" height="472" width="462" /&gt;&lt;/center&gt;&lt;p&gt; Here, we specify our ESSID (Extended Service Set ID), which is similar in concept to the Workgroup name used in Microsoft Networking and defines the ID that wireless clients should use when negotiating a connection. In addition, it is possible to specify a channel that the clients will use.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102ip.gif" alt="USB Manager - IP Setting" border="0" height="472" width="462" /&gt;&lt;/center&gt;&lt;p&gt; In order to use the SNMP Manager, the AP requires an IP address that matches the network it is connected to. By default, the ME102 has an IP address of 192.168.0.5, which could be an issue if this address is already in use on your LAN! Here we show a modified address.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102enc.gif" alt="USB Manager - Encryption" border="0" height="472" width="462" /&gt;&lt;/center&gt;&lt;p&gt; Wireless networking can be a great convenience but it does have some security issues. The Wireless Encryption Protocol (WEP), whilst not perfect, offers some protection from casual wardrivers and the ME102 offers both 64 and 128-bit WEP Key modes. When WEP is enabled, a number of keys need to be defined. These are comprised of a number of hexadecimal numbers, either 5 0r 13 depending on whether 64 or 128-bit encryption is chosen. Using 64-bit keys makes life easier as the keys are shorter, but it does make the encryption that much easier to break! 128-bit keys are longer, so harder to configure on the clients. The ME102 can hold up to four keys, but will default to the one specified. Wireless clients will need to have the same key set in order to connect to the AP.&lt;/p&gt;&lt;p&gt; The fact that the keys are hexadecimal means that each character can be either a number between 0 and 9, or a letter between A and F, so 0A 0B 0C 0D 0E is a vaild 64-bit key, as is 12 34 56 78 90. A valid 128-bit key could be 00 01 02 03 04 05 06 07 08 09 0A 0B 0C or DE AD BE EF FE ED DE AF BE EF DE AD ED. Whatever keys are used (and these are only examples not recommended for general use) they will need to be configured in any client in order to get a connection. Note, however, by default, the ME102 is set to both Open System AND Shared Key, so if only WEP clients are required to connect, then the Authentication Type needs to be set to Shared Key only.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102op.gif" alt="USB Manager- Operational Setting" border="0" height="472" width="462" /&gt;&lt;/center&gt;&lt;p&gt; The operational settings of the ME102 can largely be left at default, with the only change you should make is to change the AP's password.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Accessing the ME102 SNMP Management Console&lt;/b&gt;&lt;/p&gt;&lt;p&gt; The alternative method of managing the ME102 is to use the supplied SNMP management Utility. The SNMP utility basically has the same configuration options as the USB version except that it has set up options for MAC address locking and can also display statistics.&lt;/p&gt;&lt;p&gt; The SNMP utility is required to be installed on a Windows PC connected to the LAN. When the SNMP utility is run, it scans the network looking for ME102 APs. Once found, the AP will be displayed in a window:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102snmplog.gif" alt="ME102 SNMP Manager Login Screen" border="0" height="371" width="416" /&gt;&lt;/center&gt;&lt;p&gt; Simply select the AP to manage and click login. Enter the password when prompted and the general configuration screen will now be displayed. As this does not differ from the USB management utility the following sections will concentrate on the MAC 'locking' and statistics offerings.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Limiting Connections by MAC Address&lt;/b&gt;&lt;/p&gt;&lt;p&gt; An additional security option with the ME102 is to set it so that only known MAC addresses are allowed to connect via the wireless link. The MAC address is the unique 12 digit hexadecimal number burnt into all network interface cards, and is often called the Hardware Address. To find this address for a particular card, use either ipconfig or winipcfg, depending on your version of Windows, or ifconfig if using Un*x. Once you have the MAC address(es), create a text file on the management PC and enter them, one per line. Save the file, them from within the SNMP manager load this text file. The MAC addresses will appear as shown below:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102snmpmac2.gif" alt="ME102 SNMP Manager- Authorized MAC" border="0" height="471" width="446" /&gt;&lt;/center&gt;&lt;p&gt;  To enable these MAC addresses, click on Download to AP and also do not forget to click on Apply!&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Statistics&lt;/b&gt;&lt;/p&gt;&lt;p&gt; For what it is worth, the SNMP Manager can also display some usage statistics that show the number of packets received on both the ethernet and wireless interfaces:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/me102snmpstat.gif" alt="Me102 SNMP Manager - Statistics" border="0" height="471" width="446" /&gt;&lt;/center&gt;&lt;p&gt;  &lt;b&gt;Connecting a Wireless Client&lt;/b&gt;&lt;/p&gt;&lt;p&gt; In theory, it should be possible to connect any 802.11b compatible device via the ME102, and this would include devices from manufacturers like Linksys, D-Link and many others. Most of these cards are based on the PRISM specification, and can use the same drivers. Windows installations may be a little less forgiving, however, and you should install the appropriate drivers as supplied with the card. Linux users should consult &lt;a href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.drivers.html"&gt;Jean Tourrilhes&lt;/a&gt;'s website for info on their wireless NIC. This is an  excellent resource, IMHO.&lt;/p&gt;&lt;p&gt; Once a wireless connection is established, then conventional TCP/IP networking takes over. In other words you need a TCP/IP address, a default gateway and some sort of DNS functionality. &lt;/p&gt;&lt;p&gt; &lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-4090958202448642530?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/4090958202448642530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=4090958202448642530' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4090958202448642530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4090958202448642530'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-netgear-me102-wireless.html' title='Network Lab: Netgear ME102 Wireless Access Point'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-3555857023174313773</id><published>2008-10-31T08:18:00.000-07:00</published><updated>2008-10-31T08:21:04.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='The Linksys BEFSR41 Etherfast Cable/DSL Router'/><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><title type='text'>Network Lab: The Linksys BEFSR41 Etherfast Cable/DSL Router</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;The Linksys BEFSR41 Etherfast Cable/DSL Router&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt; 'Instant Broadband' is what it says on the tin, and it does exactly that. The BEFSR41 is a small blue/grey device, just slightly larger than a video cassette. The rear of the unit has a number of RJ45 sockets that offer a single WAN connection and 4 LAN connections. The front of the unit shows link and activity LEDs for each interface.&lt;p&gt;  The Linksys router is also available in a single or 8-port LAN version.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Connecting to Cable Modem&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Connecting the Router ot the modem is as simple as connecting a straight RJ45 cable between the WAN port of the Router and the Cable Modem. By default the Router is set to get it's WAN ip address from a DHCP server and this works very well with the NTL servers. One issue that may arise if you change an existing PC for the Linksys is that the Cable Modem will retain the MAC address of the original NIC and it can be troublesome to get the modem to see the Linksys as a new device. Two options are available: &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Power off your CM and after powering back on, allow it to re-sync with the head-end before switching on the Router. Note it may be necessary to leave the modem off for 4 hours so that your dhcp lease expires, or, &lt;/li&gt;&lt;li&gt;Configure the Linksys to have the same MAC address as your CM connected PC NIC has. This is known as MAC spoofing or, in Linksys speak, cloning. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;  &lt;b&gt;Connecting to LAN&lt;/b&gt;&lt;/p&gt;&lt;p&gt;By default, the Linksys will have a LAN IP address of 192.168.1.1 and a netmask of 255.255.255.0. This means that unless a PC that is connected to it is set to get an IP address via DHCP, then it will need setting up with an address on the 192.168.0 subnet. Be aware however, that this address must not be 192.168.1.1, nor must it be in the range 192.168.1.100 to 192.168.1.149, as this is the default DHCP scope configured on the router. You also cannot use 0 or 255 as the last number.&lt;/p&gt;&lt;p&gt; Again, a straight RJ45 cable is all that is need to connect a PC up to the Linksys. Four ports are available for the LAN side, although five physically exist. The fifth is actually an uplink port for connecting a hub or switch to the Router. Note that use of the uplink port means that port 1 is not available so in effect you have a 3 port switch in this scenario.&lt;/p&gt;&lt;p&gt; Theoretically, your Linksys connected network may look like the following diagram, which shows two PCs connected to a CM via a Linksys router. Note that both PCs have obtained their IP address from the Linksys, which in turn has got it's WAN address from the NTL dhcp server.&lt;/p&gt;&lt;p&gt;   &lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/router1.gif" alt="Linksys Router Network" border="0" /&gt;&lt;/div&gt; &lt;p&gt; In the scenario where you have more than four machines that you want to connect to the Internet, then you will need to attach further network devices to the Linksys so that the physical limit of the router can be extended. Typically, this is achieved by attaching a hub or switch to the uplink port of the router using a straight RJ45 cable. Alternatively, you could connect a hub/switch to one of the other router ports using a cross-over cable, but there would not be any real gain in doing this.&lt;/p&gt;&lt;p&gt; PCs connected to the additional hub/switch can still use the dhcp service on the Linksys, and will still be part of the 192.168.1.0 subnet. No configuration changes are needed on the router for this to work correctly. The following diagram shows how it works in practice:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/router2.gif" alt="Router With Hub" border="0" /&gt;&lt;/div&gt;&lt;p&gt;  &lt;b&gt;Integrating with your existing Network&lt;/b&gt;&lt;/p&gt;&lt;p&gt; As previously discussed, by default the BEFSR41 is designed to allow up to four PCs to connect to a Cable Modem or ADSL connection, where the WAN IP address is obtained by dhcp, and the IP addresses for the LAN clients are delivered by the router's own dhcp server range between 192.168.1.100 to 192.168.1.149. If you are moving from an existing gateway system for instance, your IP addresses may not work very well with the default settings of the router. Of course, if the PCs you already have networked are already getting their IP address via dhcp, then it should be just a matter of connecting them to the router and obtaining a new address. Note that you may need to release the old address before attempting to get an address from the router.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Changing the Default Configuration&lt;/b&gt;&lt;/p&gt;&lt;p&gt; WARNING. Changing the default settings on your Linksys can reduce the effectiveness of the security offered by the router, and in some instances stop it working all together! &lt;/p&gt;&lt;p&gt;  MAC Cloning&lt;/p&gt;&lt;p&gt;Perhaps the first thing you will want to do is to clone the MAC address of the NIC that the Cable Modem has been talking to all this time. The MAC, or Hardware, address of a particular network device, be it a NIC or a router, is unique, and consists of six hexadecimal numbers. The CM 'learns' this MAC address from the device attached to it, i.e., a NIC in a PC and will only talk to that MAC address, until it is reset and has 'forgotten' the original MAC.&lt;/p&gt;&lt;p&gt; Note that it is no longer necessary to clone MAC addresses. If you change from a PC or another router to a Linksys (or any other router) then all you should need to do is power-cycle your cable modem, then power up your new device. I have left the MAC address details in, just in case you decide to do it anyway:-)&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Finding the MAC address that the CM 'learns'&lt;p&gt; The easiest way of doing this is by using whatever facility your currently connected device has for displaying it's NIC MAC address. Make sure the device is connected to the CM service and can connect to Internet services. Run whatever utility your system has for showing the MAC address and make a note of it. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Win9X&lt;p&gt;  Use the command &lt;i&gt;winipcfg&lt;/i&gt; by selecting Run from the Start Menu. A window will be shown that looks like this:&lt;/p&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/winipcfg.gif" alt="Output from Start/Run/winipcfg" align="middle" border="0" height="241" width="312" /&gt;&lt;/p&gt;&lt;p&gt;  In Microsoft parlance, the MAC address is displayed as the Adapter Address, but is the same thing.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;WinNT/2000&lt;p&gt;  With Windows NT/2000 you need to run a DOS command window and typing the command &lt;i&gt;ipconfig /all&lt;/i&gt; . Note, that the following output is truncated in order to show  the relevant MAC address information, which Microsoft now call the Physical Address.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;pre&gt;C:\&gt;ipconfig /all&lt;br /&gt;&lt;br /&gt;Ethernet adapter Local Area Connection 5:&lt;br /&gt;&lt;br /&gt;       Connection-specific DNS Suffix  . : nigs.net&lt;br /&gt;       Description . . . . . . . . . . . : Linksys EtherFast 10/100 PC Card&lt;br /&gt;       Physical Address. . . . . . . . . : 00-E0-98-21-25-4C&lt;br /&gt;       DHCP Enabled. . . . . . . . . . . : Yes&lt;br /&gt;       Autoconfiguration Enabled . . . . : Yes&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Linux&lt;p&gt;  At your shell prompt type &lt;i&gt;ifconfig&lt;/i&gt;, which will result in output that will look very similar to that shown in the following screen dump, which shows the output from a two NIC Linux machine where eth0 is attached to an NTL Cable Modem and eth1 is attached to the internal network. Here the MAC address of the NIC is displayed as the HWaddr. This example also shows that it is important to get the correct address, or in other words, the address of the NIC attached to the Cable Modem.&lt;/p&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/ifconfig.gif" alt="Output from ifconfig" align="middle" border="0" height="350" width="428" /&gt;&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Setting up a PC to access the Linksys Manager&lt;p&gt; In an ideal world, you do not need to access the Linksys Manager in order to get it operational, but password issues aside, in order to clone your MAC address you have to. Simply connect a PC to one of the LAN ports of the router, and assuming the PC can lease an address, run a web browser set to use a LAN connection and connect to site &lt;a href="http://192.168.1.1/"&gt;http://192.168.1.1&lt;/a&gt;. A successful connection will result in you being asked for the Linksys Manager password. The default settings for this  are Username = nothing, Password = admin. CHANGE THIS PASSWORD!&lt;/p&gt;&lt;p&gt; Once connected you will be faced with the general setup interface of the Linksys. For NTL, ensure that 'Obtain an IP automatically' is selected in the WAN Connection Type section, as shown below. There is no requirement to enter either the Host Name or Domain Name.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/linksetup.jpg" alt="Default Linksys Manager Page" border="0" height="400" hspace="0" vspace="0" width="699" /&gt;&lt;/div&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Setting the MAC address&lt;p&gt; The MAC Clone option is accessed via the Advanced configuration option of the Linksys Manager. Click on the Advanced tab, then click on the MAC Addr. Clone tab.&lt;/p&gt;&lt;p&gt; Replace the shown MAC address with the address you got from your original NIC, click Apply, and that should be it. Once you return to the Manager, select the Setup tab and check the WAN MAC address is displayed correctly.&lt;/p&gt;&lt;p&gt; In my experience with the Linksys, using our internal e-smith provided dhcp server, the Linksys never needs a reboot in order to make changes such as MAC changes, but with a Cable Modem, I would suggest you power off the Linksys after making this change, just in case.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt; Changing the Default 192.168.1.0 Network&lt;/p&gt;&lt;p&gt;  Set the LAN address of the Linksys by entering the IP address and Subnet Mask on the main setup screen.&lt;/p&gt;&lt;p&gt; Changing the network number you are using from the default set-up by Linksys is only really necessary if you are connecting an existing LAN to it and that LAN does not use DHCP, or, you just want to be different. It is important to be aware, however, that the Linksys will only support up to a maximum of 253 devices, or, more specifically IP addresses attached to it and this is enforced by the fact that the minimum netmask you can use is 255.255.255.0. If you are using a 10.0.0.0 network with mask of 255.0.0.0, then a reconfiguration of the LAN machines will be necessary. Of course, that reconfiguration is quite simple if dhcp is used where a release and renew of the IP lease is all that would be required.&lt;/p&gt;&lt;p&gt; Note that any change in the Linksys LAN address will also change the Linksys DHCP address, so again a release and renew are necessary to get dhcp machines to get an address on the new network.&lt;/p&gt;&lt;p&gt;  Of course, any machines with manually assigned address will need a manual change to use the new network!&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Advanced Configuration&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  All of these options are available on the Advanced menu.&lt;/p&gt;&lt;p&gt;  Port Filtering&lt;/p&gt;&lt;p&gt; Linksys Routers, much like many other LAN sharing options, by default, allow all traffic from LAN to WAN. Port Filtering allows the blocking of particular IP addresses or ports so that particular Internet applications will not work. For instance, you may decide that you do not want anyone on your LAN using IRC, so you can the 6667 port for IRC and the Linksys will block that traffic. Note, however, that you cannot set a filter explicitly to an address. Add an address to the Filter IP Range and ALL of it's internet activity will be blocked, set a port to be blocked and all LAN machines will be denied access to that port.&lt;/p&gt;&lt;p&gt; The following screen shot shows filtering set up to block the Microsoft Networking ports. This has no effect on clients connected to the router connecting to each other, but does prevent unwanted connections that could be made outside.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/linkfilter.jpg" alt="Linksys Filtering Screen" border="0" height="775" hspace="0" vspace="0" width="702" /&gt;&lt;/div&gt;&lt;p&gt; Note also, that this screen also contains the settings for remote access, UPnP, and so on. I would recommend the settings shown for most installations, although this example does show IPSec pass-thru' enabled to allow VPN traffic out via the Internet. Enabling this would only be necessary if required, i.e, if you access work from home.&lt;/p&gt;&lt;p&gt;  Forwarding&lt;/p&gt;&lt;p&gt; Forwarding, or Port Forwarding to give it its proper name, is used to set the Linksys firewall rules to allow connections from the WAN, i.e., the Internet, to machines on the internal LAN. This could be anything for anything from a Web server to an SSH daemon, as long as you know the ports that are required to support the service.&lt;/p&gt;&lt;p&gt; The screenshot below shows port 80 (http) forwarded to an internal machine with IP address 192.168.3.99, which is running an Apache Web Server. Note that the protocol is set to TCP only, and that no UPnP forwarding or port triggering is necessary.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/linkforward.jpg" alt="Linksys Port Forward" border="0" height="485" hspace="0" vspace="0" width="699" /&gt;&lt;/div&gt;&lt;p&gt; Any clients wishing to connect to the web server must connect to the external IP address of the router, and not the LAN address of the web server. It is also possible to forward your own domain's www address to your NTL assigned address, or you can use one of the many dynamic DNS services, such as &lt;a href="http://www.dyndns.org/"&gt;dyndns.org&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;  DMZ Host&lt;/p&gt;&lt;p&gt; Having a DMZ host takes away what can be a chore setting up individual ports you want to forward for applications discussed earlier. Making a device a DMZ host causes the Linksys to advertise all of the ports that the DMZ host is advertising. Whilst this can be useful for applications such as Microsoft's Netmeeting, it can also reveal services such as FTP and Web and File and Print Sharing, which you may or may not want to advertise and I would recommend only using the DMZ facility as a last resort.&lt;/p&gt;&lt;p&gt; Another security issue with the DMZ facility of the Linksys, is that the DMZ host remains as part of the internal LAN, in the same way as machines with forwarded ports, and can make connections to the other machines on the network. If your DMZ host is compromised, your whole internal network could be as well.&lt;/p&gt;&lt;p&gt; As in the case with a host advertising ports via the forwarding facility of the Linksys, do not make your DMZ host an address that is in the range of the Linksys DHCP service. Use an address such as 192.168.1.20, or 192.168.1.30 instead.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Security Considerations&lt;/b&gt;&lt;/p&gt;&lt;p&gt; The Linksys Router does a very good job of providing a protected connection to the Internet. Once changes are made to the router's default configuration, however, it is important to remember that whilst NAT is a very good way of stopping direct connections to your LAN machines, it only actually protects you at the TCP/IP level. Applications such as HTTP or telnet can be exploited and your NAT device will quite happily pass that exploit traffic. As far is it's concerned, if traffic on port 80 is allowed, it can pass. It has no concern with the content of that traffic, merely the act of making sure that connection from a to b is allowed according to it's NAT tables.&lt;/p&gt;&lt;p&gt; For example, I decide to run a web server on a Linux machine that I have configured as the DMZ host on a router. Unbeknownst to me, this Linux machine also has a Telnet daemon running, so when the Linksys configuration sets the Linux machine as the DMZ host, it also advertises it's Telnet port. Stupid idiot that I am, my root password is blank, so if anyone scans my my NTL address for accessible ports, telnet is stting there, wide open and no password. As far as the Linksys is concerned, the telnet traffic is allowed, it does not know that I neglected to set a password on the host so it allows a connection from anywhere to the DMZ host. As the DMZ host is still on my internal network, anyone having access to the DMZ host can now start looking for other machines on the network, or even start messing with the Linksys configuration itself. Again, the Linksys would not be able to tell that the connection it has allowed to the DMZ host is actually about to set up a filter that blocks access to port 80!&lt;/p&gt;&lt;p&gt; It's fairly obvious that Port Forwarding has a distinct advantage over using the DMZ function, as you prevent accidentally leaking services. It is important to remember, tho', that just having a single port, for http say, as opposed to the whole lot, is not the end of the story. Exploits on running services are probably the main method of gaining access to other systems so it is important that any services run are ran in such way as to prevent accidental system access. It is also recommended that you also install a software firewall, such as ZoneAlarm or Tiny Personal Firewall, or at the least an intrusion detection program such as BlackIce, on the host you are forwarding to. For Linux hosts, I would recommend running your chains or tables as if you were actually connected to the Internet, especially, if you place your Linux host as the DMZ host. Of course, this is all irrelevant if your system is compromised, but at least an attempt at prevention is better than the cure, IMO.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ensure your OS is patched&lt;p&gt; Nothing more embarrassing than getting hit by an attack that could have been prevented by applying a patch that was released two years ago. This does not necessarily mean that you should apply patches as soon as they are released, however, as some patches may introduce new problems as well as fixing old ones!. Consult the support websites and forums for your system to establish that patch what is required as opposed to what there is. &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Ensure the service is patched&lt;p&gt; Same applies as above. Also consider whether there are any settings that can be set. or even utilities that can be employed that can prevent unwanted egress into your network. For instance, with SSH, you could configure it so that only known host keys can connect, or with Microsoft's IIS use IISLock to disable unwanted services within IIS itself.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Employ Firewall or IDS&lt;p&gt; On the face, of it, a waste of effort as in order to run your service, you have to open the ports for the service in the firewall anyway! There are also tools available that will disable software firewalls possibly making them doubly superfluous. Use of some firewalls can be useful, however, if they are able to block unwanted access going out of your host to other hosts on your network. If you have to use a DMZ host (such as for Netmeeting), then ensure that only the ports for the application are opened, and not all. &lt;/p&gt;&lt;p&gt;With your other LAN hosts, use a different software firewall to that used on the DMZ host as well. Note, however, there is little protection that you can apply to the Linksys to prevent tampering once your service host is compromised apart from ensuring your password is suitably strong.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Employ Up to Date AntiVirus&lt;p&gt; If you use an MS host for port forwarding or DMZ host, AV software will prevent Trojans being installed that could be used against your other LAN hosts. Also use AV on your other MS machines.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-3555857023174313773?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/3555857023174313773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=3555857023174313773' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3555857023174313773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3555857023174313773'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-linksys-befsr41-etherfast.html' title='Network Lab: The Linksys BEFSR41 Etherfast Cable/DSL Router'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-7937831176841206005</id><published>2008-10-31T08:16:00.000-07:00</published><updated>2008-10-31T08:17:29.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='networklab'/><category scheme='http://www.blogger.com/atom/ns#' term='Sygate Single NIC Gateway'/><title type='text'>Network Lab: Sygate Single NIC Gateway</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Sygate Single NIC Gateway&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt; Sygate Technologies produce an Internet Gateway product called Sygate that fits quite nicely with NTL's CM service in the instance where you do not want a dedicated PC Gateway or a Hardware Router. In-built with Sygate is the ability to implement an Internet Router/NAT service using software running on a Windows 95, 98 or NT 2000 PC containing a single Network Card. Sygate do this with the use of a 'virtual' NIC. The real NIC is set-up as your CM facing interface and obtains it's IP address via the normal Windows' DHCP mechanism. The 'virtual' NIC runs on an IP range that is completely different to the IP network allocated by NTL, thus enabling an additional network to run on the same 'network' as your PC -&gt; CM connection. The local machines are set with the 'virtual' IP address of the Sygate server as the default gateway.&lt;p&gt;  &lt;!---Diag---&gt;  &lt;b&gt;&lt;h2&gt;Obtaining and Installing Sygate&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  Syagte is a nice 5MB download from &lt;a href="http://www.sygate.com/"&gt;http://www.sygate.com&lt;/a&gt; as sygate.exe, which, when run produces a folder within which is the Sygate Home Network program, which actually installs the Sygate server. The installation prompts for either a server or client installation, and server is required if you want this machine to provide Internet access. Once installed Sygate can be configured to provide single NIC capability, DHCP services for your LAN, connection filtering and an add-on firewall function.&lt;/p&gt;&lt;p&gt;  &lt;!---Diag---&gt;  &lt;b&gt;&lt;h2&gt;Sygate Configuration&lt;/h2&gt;&lt;/b&gt; After installation and a reboot, Sygate requires licensing information to be entered prior to running. The license key for the 30-day trial version is H1001001 and no other info is required in order to run the trial.&lt;/p&gt;&lt;p&gt; The routing engine of Sygate runs as a background process, and in order to see whether your Internet link is up, or to configure you need to run the Sygate Manager. The default manager screen is shown below:&lt;/p&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/syman.gif" alt="Sygate Manager" border="0" height="355" width="380" /&gt;&lt;/p&gt;&lt;p&gt; Configuration is performed from the options available from the Advanced button on the main manger screen. Note that the Firewall, Access Rules and Permissions do not require any configuration by default for simple Internet Sharing.&lt;/p&gt;&lt;p&gt; &lt;table&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/symanad.gif" alt="Sygate Manager Advanced" border="0" height="352" width="386" /&gt;&lt;/td&gt;   &lt;td&gt;Configuration&lt;br /&gt;For Configuring the Network Operation of Sygate&lt;p&gt;    Firewall&lt;br /&gt;For access to the Sygate Firewall add-on&lt;/p&gt;&lt;p&gt;    Access Rules&lt;br /&gt;For adding access rules for various applications&lt;/p&gt;&lt;p&gt;    Activity Log&lt;br /&gt;Er, the activity log!&lt;/p&gt;&lt;p&gt;    Permissions&lt;br /&gt;Allow or disallow connection to specified hosts.&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt; Configuring Sygate to provide gateway services to your LAN is simply a case of telling Sygate which interface you are going to use for your Internet Connection, and whether you want to use a single NIC connection. To enable this and then add the Internal IP address that you wish your gateway to be. Note that in the screen dump below , the IP address shown underneath the selected NIC would normally be the address as supplied by NTL's DHCP server. The address shown in the example is one obtained by the Sygate PC NIC from our internal DHCP server, rather than NTL's. Operation, however, is identical.&lt;/p&gt;&lt;p&gt; When Single NIC is enabled, Sygate automatically sets the Gateway IP to 192.168.0.1, and this should be the address set as the client's default gateway.&lt;/p&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/syconf.gif" alt="Sygate Network Configuration" border="0" height="435" width="556" /&gt;&lt;/p&gt;&lt;p&gt; As can be seen from above the configuration of Sygate is quite straightforward with the options quite clearly labled. For instance, if you want to run a DHCP server internally, enable it here. Sygate will automatically assign a range of IP addresses but you can define your own from the options available from the Advanced button. Note that your DHCP range should be from the same IP subnet as your Sygate server is configured to be on, i.e., if Sygate Gateway IP is 192.168.0.1, then your DHCP range will need to withing the address range for that address, or from 192.168.0.2 to 192.168.0.254 if using the whole range.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Client Configuration&lt;/h2&gt;&lt;/b&gt; With DHCP enabled on Sygate, your client PCs need to be set to get their address automatically. If DNS is disabled within the TCP settings of the client, then the client should also discover it's DNS server as well as it's default gateway. Applications on the client PC need to be setup as tho' they have a direct connection to the Internet - remember that Sygate only provides NAT facilities, it does not provide proxy services, tho' some applications may need Access Rules defined in order for them to function correctly.&lt;/p&gt;&lt;p&gt; If no DHCP service is configured in Sygate, then client PCs require their TCP/IP settings to be set manually using a unique address from your network. The Gateway and DNS servers should be set to the Gateway address as defined in Sygate, e.g., 192.168.0.1 if using the default address allocated by Sygate. Again, client applications will need to be set as tho' they are connected direct to the Internet.&lt;/p&gt;&lt;p&gt; There is the facility with Sygate to create Client Configuration disks, but in reality, all this does is set the IP address of the client and it is not really needed.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;/b&gt; Sygate is an excellent way to share an Internet Connection without needing to buy additional hardware. The machine used for this trial was a Compaq Deskpro P133 with 16MB of RAM, with a single 3COM NIC and performance was suprisingly good. Note, however, Sygate is not free. It's smallest license costs $40, but this only supports three client PCs. More clients mean more cost, with there being a point at the 10 user level where a hardware router such as a Linksys is better VFM. Sygate also does not offer any firewalling capabilities beyond NAT, tho' there is a free Firewall add-on available.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-7937831176841206005?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/7937831176841206005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=7937831176841206005' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/7937831176841206005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/7937831176841206005'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-sygate-single-nic-gateway.html' title='Network Lab: Sygate Single NIC Gateway'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-8809799925611692884</id><published>2008-10-31T08:15:00.000-07:00</published><updated>2008-10-31T08:18:47.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='Using e-smith Internet Gateway on the NTL Cable Modem Service'/><title type='text'>Network Lab: Using e-smith Internet Gateway on the NTL Cable Modem Service</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Using e-smith Internet Gateway on the NTL Cable Modem Service&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt;  An excellent system for sharing your Cable Modem connection on your LAN is the e-smith Server and Gateway offering from  &lt;a href="http://www.e-smith.org/"&gt;e-smith, inc.&lt;/a&gt;. Based on a very trimmed distribution of RedHat Linux, e-smith offers an extremely effective means of using your  Cable connection to the maximum.&lt;p&gt; Despite the fact that e-smith runs a light version of RedHat, it still provides numerous services to your LAN as well as providing gateway services to the Internet. At it's very basic, e-smith is a Linux Router offering NAT and firewalling (as of Version 4.1) services but with it's ability to also operate as the Proxy, Mail, DNS and FTP servers for your LAN connected machines it can also provide both Intranet/Internet Web servers, both with CGI, PHP and SSL support. In addition Virtual Domains and Information Bays can also be set-up, resulting in an extremely flexible and powerful Internet system.&lt;/p&gt;&lt;p&gt; Perhaps the most outstanding feature of e-smith is it's administration utilities. The majority of the configuration for the system is performed from a web browser running on the internal network nearly all administration tasks can be done from it, with the important configuration available from a text-based configuration tool. You therefore do not need an extensive knowledge of Linux in order to use it, although some knowledge can be useful.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Obtaining and Installing E-Smith&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; The e-smith distribution is available for free download from the e-smith website and it is only available as an iso image, so you will need to be able to extract this image to a CD. Once you have your extracted e-smith CD, you can either boot your intended machine direct from the CDRom, or you can create a boot disk on floppy by using the included rawrite utility in the dosutils directory. Further details on the installation of e-smith are also on the e-smith &lt;a href="http://www.e-smith.org/downloads/"&gt;downloads&lt;/a&gt; page.&lt;/p&gt;&lt;p&gt; It is important to note two things when considering e-smith. The first is that installing e-smith will wipe the hard disk of the target machine, so make sure there is not data on the disk that you want, and the second is that e-smith has partial support for some hardware, so check the compatibility list to make sure you can use it.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Installation Considerations For NTL Cable Modem Service&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; During the installation process for e-smith you will be asked a couple of questions regarding your IP address settings, your hostname and your domain.&lt;/p&gt;&lt;p&gt; As regards the IP address allocation, you should enable your external facing interface to use the DHCP client with the (send ethernet address as client id) option selected. I find this option works 100% of the time. It is entirely optional to enable DHCP for the internal LAN, I choose not to, but you may prefer to do so. If you do, remember to set your LAN PCs to contact a DHCP server for their address, which they will get from your e-smith server.&lt;/p&gt;&lt;p&gt; As far as your hostname and domain settings are concerned, I would recommend setting the hostname as your NTL account name and the domain to ntlworld.com. My own set-up reflects the fact that I have my own domain registered and if you also have your own domain, then I would set your e-smith domain to be that instead as one consequence of specifying ntlworld.com as your domain is that www.ntlworld.com will resolve to your e-smith server. To some this may be an improvement, but to others it could be a major issue. If this is an issue you can bypass the e-smith proxy for this host within the setup of your browser.&lt;/p&gt;&lt;p&gt; During the configuration after installation, e-smith will also ask if you are using an Dynamic DNS facility, and I can thoroughly recommend the services available from &lt;a href="http://www.dyndns.org/"&gt;Dyndns&lt;/a&gt;. In practice this enables me to advertise my public facing web service as  &lt;a href="http://nigs.homeip.net/"&gt;http://nigs.homeip.net&lt;/a&gt;, rather than my currently assigned hostname from NTL. The e-smith setup for Dyndns requires your Dyndns username and password so that your dynamic hostname is updated automatically by the e-smith server in the event that your NTL assigned IP address changes for some reason.&lt;/p&gt;&lt;p&gt; Something else to consider is your Cable Modem's association with the MAC address of the Network Adapter connected to it. If you go thru' the process of installing an e-smith machine from scratch to replace an existing system attached to the Cable Modem, i.e., different PC and different Network cards, then you may need to reset your Modem so that the existing NIC's MAC address is deleted and the modem can re-learn your new MAC address. A method of avoiding the re-setting of the modem involves editing one of the e-smith template files so your NIC has the same MAC address of the original NIC connected to the modem.&lt;/p&gt;&lt;p&gt;  On the subject of NICs, it is important to know that e-smith only supports PCI network adapters, and you will need two of them.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Editing NIC config to avoid CM re-boot&lt;/b&gt;&lt;/p&gt;&lt;p&gt; e-smith uses templates in order to build the necessary system files and these templates take the configuration set in the manager systems and applies them to the correct file. On a conventional RedHat system, the network configuration files are held in the &lt;i&gt;/etc/sysconfig/network-scripts&lt;/i&gt; directory. e-smith also has it's network files in this  directory but they are derived from the data contained in the template files located in &lt;i&gt;/etc/e-smith/templates/etc/sysconfig/network-scripts&lt;/i&gt;. For each NIC, there is an ifcfg-ethX directory within here that e-smith uses to create the ifcfg files contained in the normal directories. Two files exist in these directories, &lt;i&gt;template-begin&lt;/i&gt;  and &lt;i&gt;template-end&lt;/i&gt;. In order to 'spoof' the MAC address of the NIC that the Cable Modem thinks you have you need to add the line:&lt;/p&gt;&lt;p&gt;  MACADDR=00DEADBEEF00&lt;/p&gt;&lt;p&gt;  (where 00DEADBEEF00 = the 12 digit MAC address of your original NIC - see '&lt;a href="http://www.networklab.co.uk/cmodem/basics.html#ipaddress"&gt;Finding Your IP Address&lt;/a&gt;', elsewhere)&lt;/p&gt;&lt;p&gt;  to the &lt;i&gt;template-begin&lt;/i&gt; file in the relevant directory, so e-smith uses this to set the hardware address of the original NIC.&lt;/p&gt;&lt;p&gt;  Of course, you can avoid doing this by pin-resetting your modem.  &lt;b&gt;&lt;h2&gt;Setting up e-smith initial configuration&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; After you have booted the system for installation, e-smith will guide you through the necessary steps to transfer the files from CD to the hard disk. Once complete, the system will reboot and automatically display the configuration screens. The default main menu of the console administrator is shown below, however, the first time e-smith is run, it bypasses this screen and allows you to set your configuration.&lt;/p&gt;&lt;p&gt;&lt;!---Configuration Walk-thru---&gt;  &lt;/p&gt;&lt;center&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/mmenu.gif" alt="e-smith main menu" border="0" height="338" width="428" /&gt;&lt;/td&gt;  &lt;td width="300"&gt;&lt;p&gt;The e-smith admin console.&lt;/p&gt;&lt;p&gt;   Use the arrow keys to select an option, this press return&lt;/p&gt;&lt;p&gt;    As can be seen, most of the options are self explanatory&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt; &lt;p&gt;  &lt;/p&gt;&lt;center&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/status.gif" alt="e-smith status page" border="0" height="338" width="428" /&gt;&lt;/td&gt;  &lt;td width="300"&gt;&lt;p&gt;The display available when 1 is selected in the main menu&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt; &lt;p&gt; Basic e-smith configuration, such as Network settings, domain name, etc., can be done by selecting option 2 from the main menu. It is possible to check your config, without the danger of inadvertantly changing the config, by selecting item 3.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/config1.gif" alt="e-smith config screen 1" border="0" height="338" width="428" /&gt;&lt;/td&gt;  &lt;td width="300"&gt;The Review Config screen covers a couple of screens worth of information so it necessary to page up and down thru' it to see all the settings.&lt;p&gt; At the top is shown the ethernet adapter assignment for the system. It just so happens that both my adapters are the same type, but you may use different ones without problems (assuming they are supported by e-smith. Notice also that my assignment shows as being 'swapped'. By default, e-smith assumes eth1 is connected to the Internet but gives the option to change this to eth0 as this is my CM facing interface.&lt;/p&gt;&lt;p&gt; The external network are settings are shown below. Here, I have specified my system as beiing a dedicated gateway and server, which gives the most flexibilty, and also told e-smith to use the DHCP client to get the IP address. Just below this are the details of the Dyndns service used. The username and password for this service are also shown here, but I have chosen to not let you see that!&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt; &lt;p&gt;  &lt;/p&gt;&lt;center&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/config2.gif" alt="e-smith config screen 2" border="0" height="338" width="428" /&gt;&lt;/td&gt;  &lt;td width="300"&gt;Paging down to see the rest of the configuration reveals the internal Network settings. Note that I have the internal DHCP facility turned off, but you may prefer to enable it.&lt;p&gt; Below this are the details for your domain and hostname. I use my own domain and have the hostname of e-smith set to gatekeeper. I do not use an external proxy as NTL's transparent proxy will trap traffic heading for Port 80 anyway. To avoid the NTL cache specify an external, public, proxy to use and ensure it runs on any other port rather than 80. I also choose to send status reports to e-smith, hence reports is set to on.&lt;/p&gt;&lt;p&gt; Console mode refers to the behaviour of e-smith when you logon as admin. In auto mode the main menu is displayed automatically.&lt;/p&gt;&lt;p&gt; This is as much configuration that is possible from the admin console. For further configuration, you need to use the e-smith manager from a web browser.&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt; &lt;p&gt; Once configured, reboot your system and, all being well, it will connect to NTL's network, via the modem.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;A word about passwords&lt;/b&gt;&lt;/p&gt;&lt;p&gt; By default the administrator account has no password, and you will need to specify one. The username is admin and you need to set the password up to be fiendishly difficult for someone else to guess, as this password also allows root access to the system. I recommend you create a password containing a combination of upper and lower case letters and numbers. For example, take the words drum and bass, then join them together and change some characters to uppercase or numbers or add some punctuation, thus 'drum and bass' becomes Drum&amp;amp;B4ss. Your e-smith system will only recognise the first 8 characters of the password, so the password will end up being truncated to Drum&amp;amp;B4s. Note, this is only an example, I do not recommend you actually use this password!&lt;/p&gt;&lt;p&gt; An alternative method of generating a password is to select a suitably long song title and take the first letter of each word in the title. For example, 'The Far Out Son of a Lung', by the Future Sound of London, results in the letters tfosoal, which we can change to be something like TF0$oa1. Again, I do not recommend you use this example for your own password, but hopefully, you get the idea.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Configuration using e-smith manager&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; To access the e-smith manager, open a web browser on one of your LAN machines and enter the URL of your server, e.g., http://gatekeeper.nigs.net:980/. You will be prompted for the admin username and password, and entering them correctly will produce the index page for the manager interface:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/emanpage1.gif" alt="e-smith manger front page 1" border="0" height="569" width="641" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-8809799925611692884?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/8809799925611692884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=8809799925611692884' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8809799925611692884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8809799925611692884'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-using-e-smith-internet.html' title='Network Lab: Using e-smith Internet Gateway on the NTL Cable Modem Service'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-2323961313673389989</id><published>2008-10-31T08:14:00.000-07:00</published><updated>2008-10-31T08:16:22.064-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2000 and ICS'/><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='networklab'/><title type='text'>Windows 2000 and ICS</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;h2&gt;Windows 2000 and ICS&lt;/h2&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt; Microsoft made a huge number of changes to their Desktop systems with the advent of Windows 2000 with nowhere the least of them made in the networking department. Still not perfect by any means, but a major step forward from the Win9x days, IMHO. One important improvement that Win2k has over Win9x is that you no longer have to reboot the PC when you change the IP address, but the improvements made to ICS over Win98SE/ME are astounding compared to that small feat! Essentially, if you install two Network Adapters in a Windows 2000 machine, Windows will allow one of them to be used for sharing it's network connection with the other adapter then being pre-set to connect to an private network. Easy.&lt;p&gt;  &lt;b&gt;&lt;h2&gt;System Requirements&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; An Internet service on a gateway machine can be processor intensive, depending both on the Gateway and Clients users' Internet Usage. This is probably more of an issue on a Windows machine than a Linux machine due to the fact that you need to have the WIndows environment up within Windows in order to use the sharing capabilities, whereas with Linux this is not normally necessary. As Windows requires Windows to be running (!), there is a great temptation to use the ICS machine as a workstation as well, but this can cause serious performance issues when clients want to use the ICS machines services. At minimum, I recommend at least a 300Mhz system with at least 128MB of RAM. If, for whatever reason, you need to use the ICS machine as a workstation as well, then I'd suggest doubling both of those.&lt;/p&gt;&lt;p&gt; Like most Internet Gateways, a Windows 2000 machine requires that it has two ethernet adapters installed, at least one of which must have a 10BaseT interface and connect to the Cable Modem using a straight RJ45 cable. The other adapter should connect to your internal network by whatever method used by the private LAN, be it RJ45, Thin/Thicknet or whatever. The information contained here uses 10baseT connectivity throughout. Like ALL gateways, it must also be switched in order for any LAN clients to be able to contact the outside world. If you do not want this situation then the only alternative is to purchase an all-in-one Gateway/Router/Firewall such as a Linksys or SMC Barricade (see the page on &lt;a href="http://www.networklab.co.uk/cmodem/routedcm.html"&gt;routers&lt;/a&gt;;-)).&lt;/p&gt;&lt;p&gt; As far as TCP/IP settings for the ICS machine, the CM attached NIC should have it's address DNS server set to be obtained automatically. The other NIC will be set, by ICS, to 192.168.0.1, so there is no need to configure anything for this. Note tho' that if you already have an address configured on NIC2 then this will be overridden when the other NIC is enabled as shared.&lt;/p&gt;&lt;p&gt; Clients that wish to use the ICS server need to have their TCP/IP properties set to automatic also. ICS will enable both a DHCP and a DNS service that the clients can use these to obtain their address, gateway and DNS server. Logically, the setup will look like that depicted in the following diag:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/win2kics.gif" alt="Win2K Network Diagram" align="middle" border="0" height="475" width="399" /&gt;&lt;/center&gt; &lt;p&gt;  &lt;b&gt;&lt;h2&gt;Enabling Sharing&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; As previously stated, adding two NICs to a Windows 2000 machine adds the facility for one of them to be a shared device that other machines on a private network can also use. Consider a Windows 200o machine that contains two Local Area connections, shown as 5 and 7 in the following screen dump. Connection 5 is connected to the Local LAN and 7 is connected to the Cable Modem, which is the interface on which sharing will be enabled.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/networksdun.jpg" alt="Network Places" align="middle" border="0" height="306" width="552" /&gt;&lt;/center&gt;&lt;p&gt; Selecting the properties for Connection 7 reveals the adapter and protocol settings. All protocols except TCP/IP should be unticked on this interface, as shown below. Notice that two tabs are available in the Properties. The Sharing tab is added automatically by Windows when two network interfaces are present.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/tcpprop.jpg" alt="Win2K TCP/IP Properties" align="middle" border="0" height="441" width="365" /&gt;&lt;/center&gt;&lt;p&gt; The properties for TCP/IP need to be set for DHCP (or, 'Obtain an IP address automatically' is ticked). In addition, DNS server addresses will also need to be set as automatic. This ensures that your ICS machine will get it's IP settings from NTL's DHCP server.&lt;/p&gt;&lt;p&gt;   &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/tcpprop2.jpg" alt="Win2k TCP/IP Properties" align="middle" border="0" height="448" width="404" /&gt;&lt;/center&gt;&lt;p&gt;  Selecting the Sharing tab reveals a single option - Enable Internet Connection Sharing for this connection.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/shareprop.jpg" alt="Win2K NIC Share Properties" align="middle" border="0" height="442" width="366" /&gt;&lt;/center&gt;&lt;p&gt; When ICS is enabled, Windows prompts a warning about changing the local LAN IP address to 192.168.0.1. Comfirm that you want sharing enabled on the interface, and setup is complete!&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/addwarn.jpg" alt="Win2K Address Warning" align="middle" border="0" /&gt;&lt;/center&gt;&lt;p&gt; The TCP/IP properties for the local LAN are reset to that shown below. No changes should be made to these properties, lest ICS is disrupted.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/tcppropin.jpg" alt="Win2K ICS Client TCP/IP Properties" align="middle" border="0" height="447" width="404" /&gt;&lt;/center&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Client TCP/IP Setup&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Enabling ICs automatically sets your network to use 192.168.0.0 as it's network number. The hosts on your network must also use this network number as part of their IP address, with the host part being a number between 2 and 254 (1 cannot be used as the ICS machine already has that address!). ICS does provide a DHCP server, so the simplest method for getting the client PCs to connect is to set them for automatic address and DNS servers. This will result in the client PCs having both default gateway and DNS server as 192.168.0.1.&lt;/p&gt;&lt;p&gt; In some instances, DHCP does not work particularly well with ICS and it may be necessary to configure the client machines manually. In this case, the client needs to have the following settings:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ol&gt;&lt;li&gt;IP address is specified as 192.168.0.101 with a mask of 255.255.255.0&lt;/li&gt;&lt;li&gt;The Gateway Address is set to 192.168.0.1&lt;/li&gt;&lt;li&gt;DNS Servers are set to 194.168.4.100 and 194.168.8.100 (these are NTL's DNS servers)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt; Subsequent machines added to the Network will also require identical settings, bar the assigned IP Address which will require the final digit to be unique. For example, addresses 192.168.0.102, 192.168.0.150 and 192.168.0.200 are all valid addresses that can be used. I would avoid using addresses in the range 192.168.0.2 to 192.168.0.100 in order to avoid any address conflicts in the event the Windows DHCP server allocates an IP address that has already been set manually on a different machine.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-2323961313673389989?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/2323961313673389989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=2323961313673389989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/2323961313673389989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/2323961313673389989'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/windows-2000-and-ics.html' title='Windows 2000 and ICS'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-5470627553025967387</id><published>2008-10-31T08:12:00.000-07:00</published><updated>2008-10-31T08:15:02.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows XP and ICS'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><title type='text'>Network Lab: Windows XP and ICS</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Windows XP and ICS&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt; Xp was another step forward by MS with ICS. Again, like Windows 2000, if you install two Network Adapters in a Windows XP machine, Windows will allow one of them to be used for sharing it's network connection with the other adapter then being pre-set to connect to a private network. Easy.&lt;p&gt; The setup requirements for ICS, be it with XP, 2000 or 98 are pretty much the same with most of the differences being in the location of the necessary setup screens. Consequently, this page looks very similar to that of the 2000 ICS setup. &lt;b&gt;&lt;h2&gt;System Requirements&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;An Internet service on a gateway machine can be processor intensive, depending both on the Gateway and Clients users' Internet Usage. This is probably more of an issue on a Windows machine than a Linux machine due to the fact that you need to have the WIndows environment up within Windows in order to use the sharing capabilities, whereas with Linux this is not normally necessary. As Windows requires Windows to be running (!), there is a great temptation to use the ICS machine as a workstation as well, but this can cause serious performance issues when clients want to use the ICS machines services. At minimum, I recommend at least a 300Mhz system with at least 128MB of RAM. If, for whatever reason, you need to use the ICS machine as a workstation as well, then I'd suggest at least doubling both of those.&lt;/p&gt;&lt;p&gt; Like most Internet Gateways, a Windows XP machine requires that it has two ethernet adapters installed, at least one of which must have a 10BaseT interface and connect to the Cable Modem using a straight RJ45 cable. The other adapter should connect to your internal network by whatever method used by the private LAN, be it RJ45, Thin/Thicknet or whatever. The information contained here uses 10baseT connectivity throughout. Like ALL gateways, it must also be switched in order for any LAN clients to be able to contact the outside world. If you do not want this situation then the only alternative is to purchase an all-in-one Gateway/Router/Firewall such as a Linksys or SMC Barricade (see the page on &lt;a href="http://www.networklab.co.uk/cmodem/routedcm.html"&gt;routers&lt;/a&gt;;-)).&lt;/p&gt;&lt;p&gt; As far as TCP/IP settings for the ICS machine are concerned, the CM attached NIC should have it's address and DNS server set to be obtained automatically. The other NIC will be set, by ICS, to 192.168.0.1, so there is no need to configure anything for this. Note tho' that if you already have an address configured on NIC2 then this will be overridden when the other NIC is enabled as shared.&lt;/p&gt;&lt;p&gt; Clients that wish to use the ICS server need to have their TCP/IP properties set to automatic also. ICS will enable both a DHCP and a DNS service that the clients can use these to obtain their address, gateway and DNS server. Detailed below are two diagrams showing deployment of ICS using XP, the first where a single client is connected to an ICS host using an CAT5 x-over cable and the second, where more than one client is connected to the ICS gateway via a hub or switch.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpics.gif" alt="XP ICS with one Client" border="0" height="163" hspace="0" vspace="0" width="609" /&gt;&lt;/center&gt; &lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpics2.gif" alt="" /&gt;1 Clients connected via a hub" border="0" height="287" hspace="0" vspace="0" width="609"&gt;&lt;/center&gt; &lt;p&gt;  &lt;b&gt;&lt;h2&gt;Enabling Sharing&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; As previously stated, adding two NICs to a Windows XP machine adds the facility for one of them to be a shared device that other machines on a private network can also use to connect to other networks. Consider a Windows XP machine that contains two Local Area connections, shown as Local Area Connection and LAC 2 in the following screen dump. LAC2 is connected to the Local LAN and Local Area Connection is connected to the Cable Modem, which is the interface on which sharing will be enabled.&lt;/p&gt;&lt;p&gt; Note that it is possible to change the labels for these icons, so it can be useful to change your shared NIC to a friendlier name such as Cable_Shared or NTL for example.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpnetconns.jpg" alt="XP Network Connections" border="0" height="304" hspace="0" vspace="0" width="487" /&gt;&lt;/center&gt;&lt;p&gt; Selecting the properties for Local Area Connection reveals the adapter and protocol settings. All protocols except TCP/IP should be unticked on this interface, as shown below. Notice that there are now three tabs available in the Properties. ICS is set via the Advanced tab.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpnetprop1.jpg" alt="XP Pro Network Properties" border="0" height="443" hspace="0" vspace="0" width="369" /&gt;&lt;/center&gt;&lt;p&gt; Selecting the Advanced tab reveals two configuration areas, Internet Connection Firewall (ICF) and Internet Connection Sharing (ICS). For ICS, there are two options. The first enables ICS operation and allows client PCs access to the Internet. The second determines whether remote operations are possible on the ICS connection. If the ICS machine is not being used as a workstation, then this option can be enabled so that client machines can administer the ICS connection.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpicsen.jpg" alt="XP ICS enabled" border="0" height="443" hspace="0" vspace="0" width="369" /&gt;&lt;/center&gt;&lt;p&gt; On XP, there is no longer a warning that the LAN connection will be set to 192.168.0.1, and after OK is clicked, the network configuration dialogue is closed. Note however, that the icon for the shared connection is now slightly different. The labels of the icons have now also been changed in the following screenshot so as to more reflect their use.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpnetconnsshared.jpg" alt="XP ICS Shared Icon" border="0" height="304" hspace="0" vspace="0" width="487" /&gt;&lt;/center&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;ICS Server TCP/IP Setup&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; The properties for the TCP/IP protocol on the NTL need to be set for DHCP (or, 'Obtain an IP address automatically' is ticked). In addition, DNS server addresses will also need to be set as automatic. This ensures that your ICS machine will get it's IP settings from NTL's DHCP server. These are actually the default settings for a NIC installed in XP.&lt;/p&gt;&lt;p&gt;   &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpautoip1.jpg" alt="XP TCP/IP Settings on CM Connection" border="0" height="448" hspace="0" vspace="0" width="406" /&gt;&lt;/center&gt;&lt;p&gt; The Advanced Button near the bottom of the panel leads to a further panel of options which enable further configuration of the TCP/IP settings, if necessary. The initial screen just informs that the NIC is set to DHCP.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpautoip2.jpg" alt="XP Advanced IP Settings" border="0" height="481" hspace="0" vspace="0" width="406" /&gt;&lt;/center&gt;&lt;p&gt;  The DNS tab is largely blank, and there is no need to make any changes to this.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpautodns2.jpg" alt="XP Advanced DNS settings" border="0" height="481" hspace="0" vspace="0" width="406" /&gt;&lt;/center&gt;&lt;p&gt; The Wins tab details the configuration for the Windows Name service, WINS and also the configuration of the NetBIOS service. You can leave the settings blank on the WINS address list, but on the NetBIOS configuration I would suggest setting this to disabled, as shown.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpautowins.jpg" alt="XP Advanced WINS  configuration" border="0" height="481" hspace="0" vspace="0" width="406" /&gt;&lt;/center&gt;&lt;p&gt; The last tab, Options, has, at the time of writing just one option, TCP/IP Filtering. This allows setting of filters for specific ports and protocols. You can leave these at default, but it is important to note that by default, windows has little protection from the nastier Internet traffic, so you should look at some form of firewall. Kerio, ZoneAlarm, Outpost, Sygate, etc., all support ICS networking. Ideally tho', the firewall should be installed before connecting your PC to the Net!.&lt;/p&gt;&lt;p&gt; The TCP/IP properties for the local LAN NIC are reset to that shown below when sharing is enabled on a NIC on the sytem. No changes should be made to these properties, lest ICS is disrupted. All other TCP/IP configuration should also be left at default. This includes Microsoft Client and File and Print Sharing, assuming you wish to share files between the ICS machine and the clients.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpicsnic2ip.jpg" alt="XP ICS Internal NIC TCP/IP Setup" border="0" height="448" hspace="0" vspace="0" width="405" /&gt;&lt;/center&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;Client TCP/IP Setup&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Enabling ICs automatically sets your network to use 192.168.0.0 as it's network number. The hosts on your network must also use this network number as part of their IP address, with the host part being a number between 2 and 254 (1 cannot be used as the ICS machine already has that address!). ICS does provide a DHCP server, so the simplest method for getting the client PCs to connect is to set them for automatic address and DNS servers. This will result in the client PCs having both default gateway and DNS server as 192.168.0.1.&lt;/p&gt;&lt;p&gt; In some instances, DHCP does not work particularly well with ICS and it may be necessary to configure the client machines manually. In this case, the client needs to have the following settings:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ol&gt;&lt;li&gt;IP address is specified as 192.168.0.101 with a mask of 255.255.255.0&lt;/li&gt;&lt;li&gt;The Gateway Address is set to 192.168.0.1&lt;/li&gt;&lt;li&gt;DNS Servers are set to 194.168.4.100 and 194.168.8.100 (these are NTL's DNS servers)&lt;p&gt; Sometimes it is necessary to configure NTL's servers manually even if the client has leased an IP address from the ICS machine. If ICS is set-up correctly and the clients have valid 192.168.0.x addresses but are not able to access the Internet, then set NTL's servers as shown below:&lt;/p&gt;&lt;p&gt;   &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/xpicsclientip.jpg" border="0" height="448" hspace="0" vspace="0" width="512" /&gt;&lt;/center&gt;&lt;p&gt;   &lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;  &lt;/p&gt;&lt;p&gt;Subsequent machines added to the Network will also require identical settings, bar the assigned IP Address which will require the final digit to be unique. For example, addresses 192.168.0.102, 192.168.0.150 and 192.168.0.200 are all valid addresses that can be used. The MS DHCP server will not allocate an address that it sees is already being used on the network.&lt;/p&gt;  &lt;p&gt;An XP machine connected via ICS setup on an XP machine will also show an Internet Gateway Icon in The Network Connections window. Here we see Droid as the Internet Gateway as seen by an XP client machine. Note, this icon only appears when XP is the ICS provider.&lt;/p&gt;  &lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/winxpicsclientconn.jpg" border="0" height="404" hspace="0" vspace="0" width="485" /&gt;&lt;/div&gt;  &lt;p&gt;This icon can be viewed as another Network connection for the local machine, so it is possible to view it's properties and, if granted access, manage the ICS connection remotely. This is a global option so if enabled, it will allow all users to change the status of ICS. The properties of such an Internet Gateway is shown below.&lt;/p&gt;  &lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/winxpicsclienticsstat.jpg" border="0" height="352" hspace="0" vspace="0" width="344" /&gt;&lt;/div&gt;  &lt;p&gt;Note that, unless allowed to do so, it will not be possible to disable or view the properties of the ICS connection.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-5470627553025967387?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/5470627553025967387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=5470627553025967387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5470627553025967387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5470627553025967387'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-windows-xp-and-ics.html' title='Network Lab: Windows XP and ICS'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-6993832483941744628</id><published>2008-10-31T08:09:00.000-07:00</published><updated>2008-10-31T08:11:34.441-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gateway device'/><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='install dedicated pc'/><title type='text'>Network Lab: Installing a Dedicated PC as a Gateway device</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;h2&gt;Installing a Dedicated PC as a Gateway device&lt;/h2&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt; This tutorial assumes that you have an existing LAN and wish to connect a gateway device to it in order to share your Cable Modem connection, although this could also easily apply to a dial-up or ISDN connection. &lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a name="choose"&gt;&lt;b&gt;Choosing the Gateway Machine&lt;/b&gt;&lt;/a&gt;&lt;p&gt;The choice of PC for your Gateway will largely depend on the Operating System you want to use, and the functionality you want your Gateway to provide. Some rough guidelines are detailed in the following table.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt; &lt;table bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="5" width="95%"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th width="300"&gt;OS&lt;/th&gt;&lt;th&gt;Services&lt;/th&gt;&lt;th&gt;Hardware Required&lt;/th&gt;&lt;th&gt;Observations&lt;/th&gt;  &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Linux&lt;/td&gt;&lt;td&gt;Routing and Firewall&lt;/td&gt;&lt;td&gt;16Mhz 486 PC, floppy drive and 16MB RAM&lt;/td&gt;&lt;td&gt;For use with floppy based Linux distributions, such as LRP and Freesco&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;Linux&lt;/td&gt;&lt;td&gt;Routing and Firewall, with Proxy&lt;/td&gt;&lt;td&gt;16Mhz 486 PC, floppy drive, 16MB RAM and HD for caching&lt;/td&gt;&lt;td&gt;Can be used with floppy based Linux distributions, such as LRP and Freesco, but can also benefit from a full Linux distribution&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;Win9x&lt;/td&gt;&lt;td&gt;Routing and Firewall, with Proxy&lt;/td&gt;&lt;td&gt;16Mhz 486 PC, 16MB RAM and HD for caching&lt;/td&gt;&lt;td&gt;Slightly underpowered but capable of providing simple connectivity using something like AnalogX under Windows, or Qmail and Squid under Linux.&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;Win9x, Win NT, Linux&lt;/td&gt;&lt;td&gt;Routing and Firewall, with Proxy&lt;/td&gt;&lt;td&gt;75Mhz Pentium PC, floppy drive, 32MB RAM and HD for caching&lt;/td&gt;&lt;td&gt;More  capable of supporting multiple proxies, email services, etc.. using something like Net Proxy under Windows.&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;Win9x, Win NT, Linux&lt;/td&gt;&lt;td&gt;Routing and Firewall with Proxy, local e-mail storage&lt;/td&gt;&lt;td&gt;166Mhz Pentium PC, floppy drive and 64MB RAM and large HD &lt;/td&gt;&lt;td&gt;More capability to run fully fledged Internet Services for your LAN. e-smith installed on this spec PC is possible.&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;/center&gt;&lt;p&gt; It should be noted that these are only guidelines and are based purely on my own personal thoughts. Whatever OS you choose, it will always benefit from more memory, processor speed and hard disk space. Linux, however, is more than capable of providing full internet services on lower end specification machines, whereas Windows OS's do require that much more performance if required to provide more than just an Internet gateway.&lt;/p&gt;&lt;p&gt;  &lt;a name="install"&gt;&lt;b&gt;Installing your Gateway Machine&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; Regardless of the OS selected for your Gateway, your Gateway machine will require the installation of two network cards, both capable of supporting at least 10MB ethernet. One will be required to connect to your Cable Modem via a straight CAT5 cable. The other will require a connection between it and your internal network. I would also recommend considering the following points: &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Use network adaptors that are suitable for your environment. If you only have PCI slots available in your machine, then you will have to use PCI cards, naturally. Also consider compatibility with your existing set-up when considering the speed of your adapter. &lt;/li&gt;&lt;li&gt;Consider installing your OS from scratch, after installing all of the required hardware. In this way you can reduce the amount of unnecessary software that is installed on your system, whilst at the same time install support for your network devices. &lt;/li&gt;&lt;li&gt;On a related note, once you have unstalled your OS apply any relevant patches that are available for your chosen system. &lt;/li&gt;&lt;li&gt;Make sure you are able to recognise which adapter is which from a network point of view. Under Linux, your cards will probably be identified as Eth0 and Eth1, whereas, under Windows, the cards will be identified by name, and if you have two cards the same, it can be difficult telling them apart. It is convention that your Eth0 adapter is the one that connects to your Cable Modem, but in reality, it can be either. &lt;/li&gt;&lt;li&gt;For Linux and 3Com adapters, consider switching off Plug and Play for these devices by using the 3Com DOS utility. &lt;/li&gt;&lt;li&gt;If you are installing Linux as a dedicated Internet Gateway, then you need to consider a) the services that you want to use, and b), how secure those services are. Most services can be helped in their security protection by simply including tcpwrappers in your selected software at install time, but applications such as Apache, Squid, DNS and Sendmail do not normally run under tcpwrappers and have their own mechanisms for preventing abuse. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt; &lt;a name="assign"&gt;&lt;b&gt;Assigning Network Protocols&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; On your Gateway, you will have two network card instances with each one having an independent IP address assignment. Your Cable Modem facing NIC will need to be set to automatically obtain an IP address, so normally nothing will need to be changed for this from the default settings if using Windows variants, but you may require additional software loaded for other other operating systems, i.e., for Linux you may need to install Pump or the dhcp client, dhcpcd, either of which are normally installed along with most default installations of RedHat, Mandrake and SUSE.&lt;/p&gt;&lt;p&gt; Your LAN facing NIC, however, will need to an have an address manually set in order to function with the rest of the machines on your network. Once you have selected the IP address range for your network, you need to select one of the address for your gateway. Either .1 or .254 are good numbers to use, as it then leaves the whole of the intervening numbers for your other hosts. &lt;/p&gt;&lt;p&gt; For example, if the network number is 192.168.0.0, then this will allow us to use the numbers 192.168.0.1 through 193.168.0.254 for our hosts. If 254 is used as the gateway's address, then each of the other machines can be allocated addresses such as 192.168.0.10, 192.168.0.20, 192.168.0.30, etc.. When setting these other machines, you need to specify the address of your gateway as the Default Router. This tells the PC's IP stack to use your gateway as the route for all your non-local traffic.&lt;/p&gt;&lt;p&gt; Note, it is also possible to set your internal machines' IP addresses by using your own dhcp server, in which case, your windows machines will need to have their IP settings set to automatic and your Un*x systems will require a dhcp client. Some Internet Sharing Software will provide this facility.&lt;/p&gt;&lt;p&gt;  &lt;!---see Nig's Net diags for setting IP addresses--&gt; In addition, you may want to setup some file or print sharing within your LAN. In order to use these services, you will need to install Microsoft Networking Client and File &amp;amp; Print Sharing on the machine you want to share drives on. Be warned, you probably do not want to run Microsoft Networking on the Cable Modem connected interface and you should not have it bound to that NIC.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-6993832483941744628?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/6993832483941744628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=6993832483941744628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/6993832483941744628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/6993832483941744628'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-installing-dedicated-pc-as.html' title='Network Lab: Installing a Dedicated PC as a Gateway device'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-3662065622267292959</id><published>2008-10-31T08:08:00.000-07:00</published><updated>2008-10-31T08:10:10.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='device'/><category scheme='http://www.blogger.com/atom/ns#' term='pc to gateway'/><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='cm'/><category scheme='http://www.blogger.com/atom/ns#' term='os lab'/><title type='text'>Network Lab: Converting an existing CM connected PC to a Gateway Device</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;h2&gt;Converting an existing CM connected PC to a Gateway Device&lt;/h2&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt; Converting your existing PC to be an Internet Gateway simply requires that you install both a second ethernet card into your PC and some software that will enable your other machines to use your PC as an Internet Gateway.&lt;p&gt;  &lt;/p&gt;  &lt;a name="select"&gt;&lt;b&gt;Selecting and Installing a Second Ethernet Card&lt;/b&gt;&lt;/a&gt;&lt;p&gt; The same criteria that you used to select your first ethernet card should also be applied to your second one, with one subtle difference. I would recommend that your second card be a 10/100 card as this will provide more flexibilty in your choice of network hardware. There is very little monetary difference between 10MB and 100MB network equipment so if your budget can stretch that little bit, go for it. Note, however, this will not necessarily improve your Internet experience as your network will be choked by that 512k connection anyway. There is also a trade-off here as well. Most 10/100 cards tend to be PCI bus only so in order to use 100M networking you may need a spare PCI slot in your PC.&lt;/p&gt;&lt;p&gt; First you need to shutdown your PC, and this has to be the hardest part of the exercise. Well, it is if you are like me and run your PC all the time! Assuming you have got over that shock, remove the case, then remove the blanking plate adjacent to the slot that you are going to insert your new card. Ensure it is firmly in and secure it with a retaining screw if necessary. Replace the lid and then connect an RJ45 cable between your new card and your network device - we'll assume it is a hub, but it could be a switch. If you don't have a hub or a switch and just wish to connect another single PC, then you will need an RJ45 cross-over cable between them instead. Restart your PC and depending on your OS, your card will either be automatically installed and the correct drivers loaded, or, you will need to manually load the relevant files to support your card. &lt;/p&gt;&lt;p&gt;  &lt;b&gt;Installation under Windows&lt;/b&gt;&lt;/p&gt;&lt;p&gt; If you network card is Plug and Play, and your PC BIOS supports PNP, then Windows will automatically start the hardware installation wizard when the machine is booted. In this case, it is just a matter of following the prompts and ensuring that you have the necessary driver disk inserted into the appropriate drive. Windows already has a number of network card drivers included in it's list of supported hardware but it is always beneficial to use the most up to date drivers, and these may well be contained on the disks that came with your card.&lt;/p&gt;&lt;p&gt; In the case where your card is not PNP, or you are using NT3.51 or NT4, then you will need to run the install hardware wizard manually from within Control Panel by double clicking the 'Add New Hardware' icon. Alternatively, your card may come with an install or setup program that will install the necessary driver files.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;Installation under Linux&lt;/b&gt;&lt;/p&gt;&lt;p&gt; Over the years Linux has had an uneasy relationship with Plug and Play devices, and generally the PNP function of any card should be disabled if possible. Newer Linux Kernels, however, may not require this and it may be worth consulting the appropriate help files on your Linux system for the definitive answer as to whether you do need to disable PNP.&lt;/p&gt;&lt;p&gt; Traditionally, network adapter support within Linux is performed by the use of modules that are loaded as part of the kernel. Older Linux kernels required that the kernel itself be edited and recompiled in order to add new hardware modules, but kernels above version 2.0 allow for the manual adding and installation of modules without this unnecessary chore. There are a number of commands available within Linux to manipulate modules and, in addition, most Linux variants come with system utilities that allow installation of new modules without the need to hack the system files directly. If you have the inclination, I would suggest that you investigate the 'manual' method of installing additional modules as this will help in your understanding of the way your Linux system is held together.&lt;/p&gt;&lt;p&gt;  &lt;a name="connect"&gt;&lt;b&gt;Connecting your Devices to your Gateway PC&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; If you have not already connected your PC to the Cable Modem, then use a straight RJ45 Cat5 Cable only to connect between the two, as you would have done previously. Any other cable will either not work or may cause problems. The Link LED on your Cable Modem may or may not come on when the connection is made as this is dependant on your card. Netgear cards will show a Link light whatever the state of the tcp/ip settings of the card, whereas 3Com cards may not actually show any link indication until the tcp/ip properties have been set through the DHCP negotiation.&lt;/p&gt;&lt;p&gt; The devices you add to your LAN will require some sort of physical connection to the internal NIC of your gateway, be it directly, via a hub, or thru' a 10base2 daisy-chain if you intend to use this network type. For RJ45 connections then you will either need a straight Cat5 cable if your Gateway connects to your LAN via a hub or a switch, or a cross-over Cat5 cable if you just have a single PC connected to your Gateway.&lt;/p&gt;&lt;p&gt;  &lt;a name="assign"&gt;&lt;b&gt;Assigning IP Addresses&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; On your Gateway, you will have two network card instances with each one having an independent IP address assignment. Your Cable Modem facing NIC will need to be set to automatically obtain an IP address, so your tcp/ip settings will need to be set to reflect this. If your are retaining the existing CM connected interface, then this should require no changes to the original configuration.&lt;/p&gt;&lt;p&gt; Your LAN facing NIC, however, will need to an have an address manually set in order to function with the rest of the machines on your network. Assuming you already have an IP address range in use on your network, then you can leave these settings as they are. However, it is common practice to set LAN gateways with either .1 or .254 as their address, as it then leaves the whole of the intervening numbers for your other hosts.&lt;/p&gt;&lt;p&gt; If you are not already doing so, then you should set your LAN IP addresses to one of the designated privately assigned number ranges, as this will avoid routing issues with any host on the Internet that just happens to have your IP addresses assigned to them.&lt;/p&gt;&lt;p&gt; The address ranges designated as privately assigned are as shown in the following table. Note that it is highly unlikely that a home network will require thousands or millions of addreses, but it is still possible to use the Class A and B address ranges for your internal network without any penalty. It is very common for the 192.168 address range to be used within a home network as it is very easy to manage.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table border="0"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td width="100"&gt;Network&lt;/td&gt;   &lt;td align="center" width="50"&gt;Class&lt;/td&gt;   &lt;td width="250"&gt;Available address Range&lt;/td&gt;   &lt;td&gt;Available number of Hosts&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;10.0.0.0&lt;/td&gt;   &lt;td align="center"&gt;A&lt;/td&gt;   &lt;td&gt;10.0.0.1 -&gt; 10.255.255.254&lt;/td&gt;   &lt;td&gt;Millions;-)&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;172.16.0.0&lt;/td&gt;   &lt;td align="center"&gt;B&lt;/td&gt;   &lt;td&gt;172.16.0.1 -&gt; 172.31.255.254&lt;/td&gt;   &lt;td&gt;Thousands;-)&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;192.168.0.0&lt;/td&gt;   &lt;td align="center"&gt;C&lt;/td&gt;   &lt;td&gt;192.168.0.1 -&gt; 192.168.255.254&lt;/td&gt;   &lt;td&gt;254 per network&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt; For example, if the network number is 192.168.0.0, then this will allow us to use the numbers 192.168.0.1 through 193.168.0.254 for our hosts. If 254 is used as the gateway's address, then each of the other machines can be allocated addresses such as 192.168.0.10, 192.168.0.20, 192.168.0.30, etc.. When setting these other machines, you need to specify the address of your gateway as the Default Router. This tells the PC's IP stack to use your gateway as the route for all your non-local traffic.&lt;/p&gt;&lt;p&gt; Ultimately, you will have something that, logically, looks like the following network diagram, with each of the private PCs being connected to the same Hub via RJ45 cables. Each PC also has a static IP address allocation that is derived from one of the private address ranges. Notice that the first three parts of the private addresses are the same. Both PC1 and PC2 have been set-up with 192.168.3.254 as their default gateway, i.e., they will use this address to connect to other networks. Note, however, without some NAT and routing software this setup will not actually work at present!&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;center&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/nettocm.gif" alt="Network Connection to Cable Modem" align="middle" border="0" height="436" width="399" /&gt;&lt;/center&gt; &lt;p&gt;  &lt;!---see Nig's Net diags for setting IP addresses--&gt;  &lt;b&gt;&lt;a name="set"&gt;Setting the Gateway software&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  In order for us to use the network we have just built we need to look at installation of some gateway or proxy software&lt;/p&gt;&lt;p&gt; There are two main requirements for your Gateway's software. It must provide NAT and it really ought to have some sort of firewall in place. If your Cable connected PC already had firewall software installed then you should be able to re-use this albeit with some minor modifications to allow your LAN machines access to the outside world. As some added value it may well be worth considering some Proxy software as well, although if you are using your gateway machine as a workstation then this could cause some performance issues.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-3662065622267292959?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/3662065622267292959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=3662065622267292959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3662065622267292959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3662065622267292959'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-converting-existing-cm.html' title='Network Lab: Converting an existing CM connected PC to a Gateway Device'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-116507484047250788</id><published>2008-10-31T08:05:00.000-07:00</published><updated>2008-10-31T08:08:33.911-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='networklab'/><category scheme='http://www.blogger.com/atom/ns#' term='win98'/><category scheme='http://www.blogger.com/atom/ns#' term='ICS'/><title type='text'>Network Lab : Win98 and ICS</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;h2&gt;Win98 and ICS&lt;/h2&gt;&lt;/b&gt;&lt;/div&gt;  If you have a PC running Windows 98 SE or above (this includes Windows 98 ME and Windows  2000) then it is possible to use Internet Connection Sharing as included by Microsoft with these  versions of the OS.&lt;p&gt;  Whilst ICS is not the most functional of methods available for Internet Sharing, it has the advantage  that it is relatively easy to set up and is free. Quite a number of folks use it quite happily but it can  cause performance problems and can be a pain to set up for unusual TCP/IP ports for software such as games, PCAW and VPN services, for example.&lt;/p&gt;&lt;p&gt;  &lt;b&gt;&lt;h2&gt;System Requirements&lt;/h2&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;  System requirements for ICS vary. It is possible to run it on a relatively low-spec machine such as a 200 or 300MHz machine, but use the PC for anything else and network response will suffer, both for  the ICS machine itself and for all the clients using it for Internet services. Having said that, faster  machines can also suffer with performance problems when using ICS, again more so when the  machine running ICS is used as a workstation as well.&lt;/p&gt;&lt;p&gt;  In order for your PC to be used for ICS with a Cable Modem, the PC needs to have two ethernet  cards installed. One connects to the Cable Modem and the other connects to your local network by whatever architecture being used. The Modem connected interface should be set for TCP/IP  protocol only and should be set to get an IP address automatically. The Network facing NIC  requires manual setting to have the address 192.168.0.1 with a subnet mask of 255.255.255.0, but it can also have other services installed as well, such as Microsoft Networking if required. All of the  client PCs are required to automatically get their TCP/IP address, which they will get from the ICS  DHCP server running on the gateway PC.&lt;/p&gt;&lt;p&gt;  The following diagram shows logically how everything connects together in an RJ45 environment. &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt; &lt;img src="http://www.networklab.co.uk/cmodem/images/win98ics.gif" alt="ICS Network Diagram" align="middle" border="0" height="475" hspace="0" width="399" /&gt;&lt;/div&gt;   &lt;p&gt; If you only have one PC to connect with the ICS gateway, the PCs can be connected together  using an RJ45 Cross-over cable (assuming RJ45 is being used).&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;h2&gt;&lt;strong&gt;IP Address Configuration&lt;/strong&gt;&lt;/h2&gt;&lt;p&gt;  There are three separate TCP/IP configurations you need to consider:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;ol&gt;&lt;li&gt;ICS PC to Cable Modem&lt;br /&gt;  In Control Panel, dbl-click on the Network Icon, or right-click on Network    Neighborhood on the desktop and select Properties. Select Properties for the TCP/IP   settings for the NIC connected to your modem. Ensure that:&lt;p&gt;      &lt;/p&gt;&lt;ol&gt;&lt;li&gt;IP Address is set to 'Obtain an IP address automatically'.&lt;/li&gt;&lt;li&gt;DNS is disabled&lt;/li&gt;&lt;li&gt;There are no Gateways set.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;p&gt;  &lt;/p&gt;&lt;li&gt;ICS PC to Local Network&lt;br /&gt;  Using the same methods outlined above, select the interface connected to the local   network. Ensure that:&lt;p&gt;      &lt;/p&gt;&lt;ol&gt;&lt;li&gt;IP address is specified as 192.168.0.1 with a mask of 255.255.255.0&lt;/li&gt;&lt;li&gt;DNS is disabled&lt;/li&gt;&lt;li&gt;There are no gateways set&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;p&gt;  &lt;/p&gt;&lt;li&gt;Network PC&lt;br /&gt;  Any PCs attached to the Network should have the same settings shown, which are    actually identical to the Modem connected NIC in the ICS machine. Note, however that   the client PCs will probably not find an address until ICS is set up and running on    the gateway.&lt;p&gt;     &lt;/p&gt;&lt;ol&gt;&lt;li&gt;IP Address is set to 'Obtain an IP address automatically'.&lt;/li&gt;&lt;li&gt;DNS is disabled&lt;/li&gt;&lt;li&gt;There are no Gateways set.&lt;/li&gt;&lt;/ol&gt;    &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;  &lt;strong&gt;&lt;h2&gt;Setting up ICS on the Gateway PC&lt;/h2&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;  In order to set up ICS on the Gateway machine, run the ICS Networking Wizard, which configures  ICS based on the responses given. The first screen is the introduction:&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics1s.jpg" alt="ICS Wizard 1" border="0" height="312" width="402" /&gt;&lt;/div&gt;&lt;p&gt;  And the second asks whether to change the Home Networking settings, or to create a boot disk.  Select the Home Network Settings, and the wizard will continue through the settings.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics2s.jpg" alt="ICS Wizard 2" border="0" height="312" width="402" /&gt;&lt;/div&gt;&lt;p&gt;  The next screen asks whether ICS should be set up for a server or client. Select Direct Connection  to ISP and select the adapter to use. This must be the adapter that is connected to the Modem.&lt;/p&gt;&lt;p&gt;  If you are setting up a Client PC, then select Connection via another PC on the Network.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics3s.jpg" alt="ICS Wizard 3" border="0" height="312" width="402" /&gt;&lt;/div&gt;&lt;p&gt;  Set the next screen to determine the Local Network connection and to enable it for Internet Sharing.  Again, it is important to select the correct interface.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics4s.jpg" alt="ICS Wizard 4" border="0" height="312" width="402" /&gt;&lt;/div&gt;&lt;p&gt; The following two screens determine the Microsoft Network options that you want to set on the Local Network. If the default Workgroup name is kept, that all devices on the local network need to be in this workgroup as well.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics5s.jpg" alt="ICS Wizard 5" border="0" height="312" width="402" /&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/ics6s.jpg" alt="ICS Wizard 6" border="0" height="312" width="402" /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt; Finally, the ICS wizard asks if you wish to create an ICS startup Disk. Select yes, only if you want to create one, otherwise, selecting 'No' finishes the ICS Wizard.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;div align="center"&gt;&lt;img src="http://www.networklab.co.uk/cmodem/images/ics7s.jpg" alt="ICS Wizard 7" border="0" height="312" width="402" /&gt;&lt;p&gt;  &lt;img src="http://www.networklab.co.uk/cmodem/images/ics8s.jpg" alt="ICS Wizard 8" border="0" height="312" width="402" /&gt;&lt;/p&gt;&lt;/div&gt;  &lt;strong&gt;&lt;h2&gt;Testing Everything Works&lt;/h2&gt;&lt;/strong&gt;&lt;p&gt; Once the Gateway PC is rebooted the first thing to check is that an IP address has been set on the Modem connected adapter - run winipcfg from the Start/Run dialog box. If this has an IP address that starts with 169, then the address negotiation failed and Windows has allocated a default. This should only really occur if the NIC attached to the CM has physically changed. In this case, power off the modem, then turn it back on again. Wait for it to negotiate with the head-end and then reboot the gateway machine.&lt;/p&gt;&lt;p&gt; Assuming that the connection from Gateway to Internet is correct, then boot up one of the client PCs. Again, use winipcfg (or whatever utility is available on the OS of the client PC) to check that an address of 192.168.0.x is set, where x is any number from 2 to 254. If this is the case then try pinging the gateway machine using &lt;em&gt;ping 192.168.0.1&lt;/em&gt; from a DOS command prompt.&lt;/p&gt;&lt;p&gt;  If the local Ping works, then, from the client, try pinging a site on the Net, for instance  &lt;em&gt;ping www.bbc.co.uk&lt;/em&gt;. If this responds OK, then it should be just a case of running your  browser in order to use the Net from the Client PC&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-116507484047250788?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/116507484047250788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=116507484047250788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/116507484047250788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/116507484047250788'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/network-lab-win98-and-ics.html' title='Network Lab : Win98 and ICS'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-336293392502048106</id><published>2008-10-22T22:59:00.000-07:00</published><updated>2008-10-22T23:26:37.602-07:00</updated><title type='text'>Lab exam 4</title><content type='html'>#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;string.h&amp;gt;&lt;br /&gt;#include&amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include&amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include&amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;#include&amp;lt;sys/msg.h&amp;gt;&lt;br /&gt;#include&amp;lt;fcntl.h&amp;gt;&lt;br /&gt;typedef struct msgbuf {&lt;br /&gt;long mtype;&lt;br /&gt;char mtext[128];&lt;br /&gt;} message_buf;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int pid,msqid,msgflag,key = 1,FD, i, c, length;&lt;br /&gt;char ch[2];&lt;br /&gt;message_buf sbuf,rbuf;&lt;br /&gt;msgflag = IPC_CREAT  0666;&lt;br /&gt;FD = open ("a.txt",O_RDONLY);       // OPEN THE FILE a.txt&lt;br /&gt;&lt;br /&gt;printf("\nIn process 1.\n");&lt;br /&gt;&lt;br /&gt;/* to get the size of the file */&lt;br /&gt;&lt;br /&gt;struct stat file_status;&lt;br /&gt;if(stat("a.txt", &amp;amp;file_status) != 0)&lt;br /&gt;{&lt;br /&gt;perror("could not stat");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* To read the entire file  */&lt;br /&gt;read(FD,sbuf.mtext,file_status.st_size);&lt;br /&gt;&lt;br /&gt;printf("Message to be send : %s",sbuf.mtext);&lt;br /&gt;&lt;br /&gt;length = strlen(sbuf.mtext)+1;    // SIZE OF THE MESSAGE BUFFER&lt;br /&gt;msqid = msgget(key,msgflag);    // CREATE QUEUE&lt;br /&gt;sbuf.mtype = 1;                             // MESSAGE TYPE&lt;br /&gt;&lt;br /&gt;msgsnd(msqid,&amp;amp;sbuf,length, IPC_NOWAIT);    //   SEND MESSAGE&lt;br /&gt;&lt;br /&gt;printf("\tMessage send \n");&lt;br /&gt;&lt;br /&gt;/* Creating a new process */&lt;br /&gt;pid = fork();&lt;br /&gt;if(pid == 0)&lt;br /&gt;{&lt;br /&gt;printf("\nIn process 2.\n");&lt;br /&gt;/* Recieving Message  */&lt;br /&gt;if(msgrcv(msqid,&amp;amp;rbuf, 128, 1, 0) &amp;lt; 0)&lt;br /&gt;printf("Error");&lt;br /&gt;c=0;&lt;br /&gt;/* To count the no. of words */&lt;br /&gt;for(i=0;i&amp;lt;length;i++)&lt;br /&gt;{&lt;br /&gt;if(&lt;br /&gt;if((rbuf.mtext[i] == ' 'rbuf.mtext[i] == '\n')&amp;amp;&amp;amp;(rbuf.mtext[i] != ' 'rbuf.mtext[i-1]!= '\n'))&lt;br /&gt;c++;&lt;br /&gt;}&lt;br /&gt;printf("\tNo. of words = %d \n",c);&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-336293392502048106?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/336293392502048106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=336293392502048106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/336293392502048106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/336293392502048106'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/lab-exam-4.html' title='Lab exam 4'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-7450492994466084674</id><published>2008-10-16T18:58:00.000-07:00</published><updated>2008-10-18T22:14:04.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oslab'/><category scheme='http://www.blogger.com/atom/ns#' term='6th sem oslab'/><category scheme='http://www.blogger.com/atom/ns#' term='osandnetworklab'/><category scheme='http://www.blogger.com/atom/ns#' term='os and network lab'/><category scheme='http://www.blogger.com/atom/ns#' term='6th sem cslab'/><category scheme='http://www.blogger.com/atom/ns#' term='networklab'/><category scheme='http://www.blogger.com/atom/ns#' term='shared memory'/><title type='text'>Shared Memory</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;shmserver.c&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include&amp;lt;string.h&amp;gt;&lt;br /&gt;#include&amp;lt;sys/shm.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int shmid;&lt;br /&gt;char *shm;&lt;br /&gt;shmid = shmget( 5678,7,IPC_CREAT|0644 );&lt;br /&gt;shm = shmat( shmid,NULL,0);&lt;br /&gt;strcpy( shm,"HELLO WORLD");&lt;br /&gt;printf("Written string to shared memory.\n");&lt;br /&gt;while( shm[0] != 'printf( "Exiting Server\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;shmclient.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include&amp;lt;string.h&amp;gt;&lt;br /&gt;#include&amp;lt;sys/shm.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int shmid;&lt;br /&gt;char *shm;&lt;br /&gt;shmid = shmget( 5678,7,IPC_CREAT|0644 );&lt;br /&gt;shm = shmat( shmid,NULL,0);&lt;br /&gt;shm[5] = '\0';&lt;br /&gt;printf( "Output = %s\n",shm);&lt;br /&gt;shm[0] = '}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Sample Output&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPfy7zj8xjI/AAAAAAAAAAM/A1KqRHyIM4I/s1600-h/Image21-400.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPfy7zj8xjI/AAAAAAAAAAM/A1KqRHyIM4I/s320/Image21-400.jpg" alt="" id="BLOGGER_PHOTO_ID_5257938199245538866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPfy72Fr0mI/AAAAAAAAAAU/GRaytxjjiTs/s1600-h/Image22-400.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPfy72Fr0mI/AAAAAAAAAAU/GRaytxjjiTs/s320/Image22-400.jpg" alt="" id="BLOGGER_PHOTO_ID_5257938199923905122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPfy8BCxelI/AAAAAAAAAAc/9e1ualGz8qI/s1600-h/Image23-400.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPfy8BCxelI/AAAAAAAAAAc/9e1ualGz8qI/s320/Image23-400.jpg" alt="" id="BLOGGER_PHOTO_ID_5257938202864482898" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-7450492994466084674?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/7450492994466084674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=7450492994466084674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/7450492994466084674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/7450492994466084674'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/shared-memory.html' title='Shared Memory'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Jz6jbQjPIno/SPfy7zj8xjI/AAAAAAAAAAM/A1KqRHyIM4I/s72-c/Image21-400.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-8906591596812070589</id><published>2008-10-10T08:46:00.000-07:00</published><updated>2008-10-13T06:38:36.733-07:00</updated><title type='text'>Lab exam question no.3</title><content type='html'>&lt;span style="color: rgb(0, 153, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;Three process p1,p2 &amp;amp; p3.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;p1 is to create a named pipe &amp;amp; to send a string through that pipe,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;p1 should read the msg thrgh keyboard.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;p2 is to read msg frm named pipe and to reverse string.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;now create a pipe and send the reversed string to the pipe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;process p3 read the reversed string from the pipe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;ok this is the question??&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/stat.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int main()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int pid,fd[2],fdo,i,len;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char msg[20],temp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;mkfifo("fifo",0777);         // creating a named pipe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;fdo = open("fifo",O_RDWR);   // opening the named pipe.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pipe(fd);                    // creating a pipe.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("In Process 1.\n\tEnter a message : ");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;scanf("%s",msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;len = strlen(msg);  // length of the message &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/* write the message to the named pipe */       &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("\tWriting %s to a named pipe\n",msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;write(fdo,msg,len);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pid=fork();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if(pid == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      printf("\nIn Process 2\n\tReading from named pipe.\n");       &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; read(fdo,msg,len);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf( "\tMessage read : %s\n", msg);&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; for(i=0;i&amp;lt;len/2;i++)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  temp = msg[i];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  msg[i] = msg[len-1-i];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  msg[len-1-i] = temp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf("\tWriting %s to a pipe.\n",msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; write(fd[1],msg,len);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else if(pid&amp;gt;0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      pid = fork();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      if(pid == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            printf("\nIn Process 3\n\tReading from the pipe.\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            read(fd[0],msg,len);                    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       printf("\tMessage read from pipe : %s\n",msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      printf("\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;A sample output. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;dipin@dipin-desktop:~/programs$ ./a.out&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In Process 1.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Enter a message : dipinkrishna&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Writing dipinkrishna to a named pipe&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In Process 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Reading from named pipe.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Message read : dipinkrishna&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Writing anhsirknipid to a pipe.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In Process 3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Reading from the pipe.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Message read from pipe : anhsirknipid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;dipin@dipin-desktop:~/programs$ &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;*/&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-8906591596812070589?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/8906591596812070589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=8906591596812070589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8906591596812070589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8906591596812070589'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/lab-exam-question-no3.html' title='Lab exam question no.3'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-3312973911942202031</id><published>2008-10-10T08:45:00.000-07:00</published><updated>2008-10-13T06:39:02.372-07:00</updated><title type='text'>Lab exam question no.2</title><content type='html'>&lt;span style="color: rgb(0, 102, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Three process p1,p2 &amp;amp; p3.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;p1 should read the msg thrgh keyboard and send it to a message queue.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;p2 is to read msg frm the message queue and to reverse string.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;now create a pipe and send the reversed string to the pipe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;process p3 read the reversed string from the pipe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;ok this is the question??&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/ipc.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/msg.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#define MSGSZ 128&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Declare the message structure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;typedef struct msgbuf {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;long mtype;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char mtext[MSGSZ];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;} message_buf;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;main()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int pid;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int msqid;  // Used to store the message queue id.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int msgflg = IPC_CREAT | 0666;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;key_t key;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/* pointers to send and recieve message buffer.*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;message_buf sbuf,rbuf;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;size_t buf_length;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int fd[2],i;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char msg[20],temp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Get the message queue id for the&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* "name" 1234, which was created by&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* the server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;key = 1234;  // A default key is used.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("In process 1\n\tEnter the message : ");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;scanf("%s",sbuf.mtext);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*  Creating a message queue.   */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("\n\tmsgget: Calling msgget(%#lx,\%#o)\n",key, msgflg);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if ((msqid = msgget(key, msgflg )) &amp;lt; 0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; perror("\tmsgget");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("\tmsgget: msgget succeeded: msqid = %d\n", msqid);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* We'll send message type 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;sbuf.mtype = 1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;buf_length = strlen(sbuf.mtext) + 1 ;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Send a message.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if (msgsnd(msqid, &amp;amp;sbuf, buf_length, IPC_NOWAIT) &amp;lt; 0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf ("\n\t%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; perror("\tmsgsnd");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("\n\tMessage: \"%s\" Sent\n", sbuf.mtext);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pipe(fd);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pid = fork();    // Create the process p2.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if(pid==0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf("\nIn process 2.\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; * Receive an answer of message type 1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; if (msgrcv(msqid, &amp;amp;rbuf, MSGSZ, 1, 0) &amp;lt; 0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  perror("\tmsgrcv");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; * Print the answer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf("\tMessage recieved : %s\n", rbuf.mtext);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; buf_length=buf_length-1; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /* Reverse the message */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; for(i=0;i&amp;lt;buf_length/2;i++)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  temp = rbuf.mtext[i];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  rbuf.mtext[i] = rbuf.mtext[buf_length-1-i];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  rbuf.mtext[buf_length-1-i] = temp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf("\tWriting %s to a pipe.\n",rbuf.mtext);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; write(fd[1],rbuf.mtext,buf_length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if(pid &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; pid = fork();   // Create the process p3.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; if(pid == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  printf("\nIn process 3.");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  /*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   Read from the pipe.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  read(fd[0],msg,buf_length-1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  msg[buf_length-1]='\0';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  printf("\n\tMessage read from the pipe : %s\n",msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;A sample ouput.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;dipin@dipin-desktop:~/programs$ ./a.out&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In process 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Enter the message : dipinkrishna&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; msgget: Calling msgget(0x4d2,01666)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; msgget: msgget succeeded: msqid = 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Message: "dipinkrishna" Sent&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In process 2.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Message recieved : dipinkrishna&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Writing anhsirknipid to a pipe.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;In process 3.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; Message read from the pipe : anhsirknipid&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;dipin@dipin-desktop:~/programs$ &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;*/&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-3312973911942202031?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/3312973911942202031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=3312973911942202031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3312973911942202031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3312973911942202031'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/lab-exam-question-no2.html' title='Lab exam question no.2'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-5748155913319807174</id><published>2008-10-10T08:37:00.000-07:00</published><updated>2008-10-13T06:37:28.634-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pipe'/><category scheme='http://www.blogger.com/atom/ns#' term='fifo'/><title type='text'>Lab exam question no.1</title><content type='html'>&lt;div style="text-align: justify; color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;write an c program to create 3 processers p1 p2 p3 , process p1 is to read a message through the keyboard and to write that message in a pipe after filtering the vowels process p2 is to read that message from the pipe and to write that message into a named pipe process 3 is to read that message queue and to display that in screen&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include&amp;lt;sys/types.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include&amp;lt;sys/stat.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include&amp;lt;fcntl.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int main()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int pid,fd[2],fdo,i;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char s[10],msg[20],ch[2];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;mkfifo("fifo",0777);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;fdo = open("fifo",O_RDWR);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pipe(fd);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("In Process 1 \n Enter a message : ");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;scanf("%s",msg);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;for(i=0;msg[i]!='\0';i++)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;      &lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          if(msg[i]!='a' &amp;amp;&amp;amp; msg[i]!='e' &amp;amp;&amp;amp; msg[i]!='i' &amp;amp;&amp;amp; msg[i]!='o' &amp;amp;&amp;amp; msg[i]!='u' &amp;amp;&amp;amp; msg[i]!='A' &amp;amp;&amp;amp; msg[i]!='E' &amp;amp;&amp;amp; msg[i]!='I' &amp;amp;&amp;amp; msg[i]!='O' &amp;amp;&amp;amp; msg[i]!='U')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                write(fd[0],msg[i],1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                printf("%c",msg[i]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    write(fd[1],"\0",1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pid=fork();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if(pid == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    printf("\nIn Process 2  : writing from pipe to a named pipe.\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    read(fd[0],ch,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    while(ch[0]!='\0')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    {         &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          write(fdo,ch,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          read(fd[0],ch,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else if(pid&amp;gt;0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    pid = fork();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    if(pid == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          printf("\nIn Process 3 \nThe message from the named pipe is : \n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          read(fdo,ch,1); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          while(ch[0]!='\0')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                read(fdo,ch,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                printf("%c",ch[0]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          }   &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    printf("\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-5748155913319807174?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/5748155913319807174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=5748155913319807174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5748155913319807174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/5748155913319807174'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/lab-exam-question-no1.html' title='Lab exam question no.1'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-4112841428303431033</id><published>2008-10-09T21:27:00.000-07:00</published><updated>2008-10-13T06:33:22.092-07:00</updated><title type='text'>Program to sent a message by process p1 and to recieve that message by process p2.</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/ipc.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;sys/msg.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;#define MSGSZ 128&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Declare the message structure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;typedef struct msgbuf {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;long mtype;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char mtext[MSGSZ];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;} message_buf;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;main()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int pid;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int msqid;  // used to store the message queue id.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int msgflg = IPC_CREAT | 0666;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;key_t key;  // used to store the key for the msg queue.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;message_buf sbuf,rbuf;   // pointers to the message buffers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;size_t buf_length;       // used to store the msg buffer size.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Get the message queue id for the&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* "name" 1234, which was created by&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* the server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;key = 1234;    // key is assigned a default value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("\nmsgget: Calling msgget(%#lx,\%#o)\n",key, msgflg);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if ((msqid = msgget(key, msgflg )) &amp;lt; 0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;perror("msgget");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("msgget: msgget succeeded: msqid = %d\n", msqid);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* We'll send message type 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;sbuf.mtype = 1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("msgget: msgget succeeded: msqid = %d\n", msqid);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(void) strcpy(sbuf.mtext, "Did you get this?");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;buf_length = strlen(sbuf.mtext) + 1 ;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* Send a message.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if (msgsnd(msqid, &amp;amp;sbuf, buf_length, IPC_NOWAIT) &amp;lt; 0) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;perror("msgsnd");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("Message: \"%s\" Sent\n", sbuf.mtext);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/* Create a new process to receive the message */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;pid = fork();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if(pid==0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; * Receive an answer of message type 1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; if (msgrcv(msqid, &amp;amp;rbuf, MSGSZ, 1, 0) &amp;lt; 0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  perror("msgrcv");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  exit(1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; * Print the answer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; printf("Message recieved :%s\n", rbuf.mtext); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;exit(0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-4112841428303431033?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/4112841428303431033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=4112841428303431033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4112841428303431033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4112841428303431033'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/program-to-sent-message-by-process-p1.html' title='Program to sent a message by process p1 and to recieve that message by process p2.'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-8785882192197521592</id><published>2008-10-08T00:03:00.001-07:00</published><updated>2008-10-13T06:33:50.144-07:00</updated><title type='text'>Interprocess Communication (IPC), Pipes</title><content type='html'>&lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="SECTION002300000000000000000"&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);font-family:&amp;quot;;font-size:130%;"  &gt;We have now began to see how multiple processes may be running on a machine and maybe be controlled (spawned by &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);font-family:&amp;quot;;font-size:130%;"  &gt;fork()&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);font-family:&amp;quot;;font-size:130%;"  &gt; by one of our programs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;In numerous applications there is clearly a need for these processes to communicate with each exchanging data or control information. There are a few methods which can accomplish this task. We will consider: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="color: rgb(0, 0, 0);" type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Pipes &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Signals &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Message Queues &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Semaphores &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Shared Memory &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Sockets &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;In this chapter, we will study the piping of two processes. We will study the others in turn in subsequent chapters. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="SECTION002310000000000000000"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Piping in a C program:  &amp;lt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;stdio.h&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&amp;gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Piping is a process where the input of one process is made the input of another. We have seen examples of this from the UNIX command line using &lt;span style=""&gt;|&lt;/span&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;We will now see how we do this from C programs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;We will have two (or more) &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;forked&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; processes and will communicate between them. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;We must first open a &lt;i&gt;pipe&lt;/i&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;UNIX allows two ways of opening a pipe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="SECTION002320000000000000000"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;popen()&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt; -- Formatted Piping&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;FILE *popen(char *command, char *type)&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; -- opens a pipe for I/O where the command is the process that will be connected to the calling process thus creating the &lt;i&gt;pipe&lt;/i&gt;. The type is either ``r'' - for reading, or ``w'' for writing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;popen()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; returns is a stream pointer or NULL for any errors. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;A pipe opened by &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;popen()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; should always be closed by &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;pclose(FILE *stream)&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;We use &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;fprintf()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; and &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;fscanf()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; to communicate with the pipe's &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;stream&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="SECTION002330000000000000000"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;pipe()&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt; -- Low level Piping&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;int pipe(int fd[2])&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; -- creates a pipe and returns two file descriptors, &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;fd[0], fd[1]&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;. &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;fd[0]&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; is opened for reading, &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;fd[1]&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; for writing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;pipe()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; returns 0 on success, -1 on failure and sets &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;errno&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; accordingly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The standard programming model is that after the pipe has been set up, two (or more) cooperative processes will be created by a fork and data will be passed using &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;read()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; and &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;write()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Pipes opened with &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;pipe()&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; should be closed with &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;close(int fd)&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Example: Parent writes to a child &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;int pdes[2];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;pipe(pdes);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;if ( fork() == 0 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;  { /* child */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;close(pdes[1]); /* not required */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;read( pdes[0]); /* read from parent */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;.....&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;{ close(pdes[0]); /* not required */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;write( pdes[1]); /* write to child */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;.....&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;An futher example of piping in a C program is &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;plot.c and subroutines and it performs as follows: &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="color: rgb(0, 0, 0);" type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The program has two modules      plot.c (main) and plotter.c. &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The program relies on you      having installed the freely &lt;i&gt;gnuplot&lt;/i&gt; graph drawing program in the      directory /usr/local/bin/ (in the listing below at least) -- this path      could easily be changed. &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The program plot.c calls &lt;i&gt;gnuplot&lt;/i&gt;      &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;Two Data Stream is generated      from Plot &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;i&gt;&lt;span style=";font-family:&amp;quot;;" &gt;y&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; = &lt;i&gt;sin&lt;/i&gt;(&lt;i&gt;x&lt;/i&gt;) &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;i&gt;&lt;span style=";font-family:&amp;quot;;" &gt;y&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt; = &lt;i&gt;sin&lt;/i&gt;(1/&lt;i&gt;x&lt;/i&gt;)&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;2 Pipes created -- 1 per Data Stream.      &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;°&lt;i&gt;Gnuplot&lt;/i&gt; produces      ``live'' drawing of output. &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The code listing for plot.c is: &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* plot.c - example of unix pipe. Calls gnuplot graph drawing package to draw&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;graphs from within a C program. Info is piped to gnuplot */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* Creates 2 pipes one will draw graphs of y=0.5 and y = random 0-1.0 */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* the other graphs of y = sin (1/x) and y = sin x */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* Also user a plotter.c module */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* compile: cc -o plot plot.c plotter.c */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include "externals.h"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include &amp;lt;signal.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#define DEG_TO_RAD(x) (x*180/M_PI)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;double drand48();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void quit();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;FILE *fp1, *fp2, *fp3, *fp4, *fopen();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;{&lt;span style=""&gt;   &lt;/span&gt;float i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;float y1,y2,y3,y4;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;/* open files which will store plot data */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;if ( ((fp1 = fopen("plot11.dat","w")) == NULL) ||&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;           &lt;/span&gt;((fp2 = fopen("plot12.dat","w")) == NULL) ||&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;((fp3 = fopen("plot21.dat","w")) == NULL) ||&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;             &lt;/span&gt;((fp4 = fopen("plot22.dat","w")) == NULL) )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;              &lt;/span&gt;{ printf("Error can't open one or more data files\n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;exit(1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;signal(SIGINT,quit); /* trap ctrl-c call quit fn */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;StartPlot();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;y1 = 0.5;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;srand48(1); /* set seed */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;for (i=0;;i+=0.01) /* increment i forever use ctrl-c to quit prog */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;{ y2 =&lt;span style=""&gt;  &lt;/span&gt;(float) drand48();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;if (i == 0.0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;           &lt;/span&gt;y3 = 0.0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;           &lt;/span&gt;y3 = sin(DEG_TO_RAD(1.0/i));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;y4 = sin(DEG_TO_RAD(i));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;/* load files */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fprintf(fp1,"%f %f\n",i,y1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fprintf(fp2,"%f %f\n",i,y2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fprintf(fp3,"%f %f\n",i,y3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fprintf(fp4,"%f %f\n",i,y4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;/* make sure buffers flushed so that gnuplot */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;/*&lt;span style=""&gt;  &lt;/span&gt;reads up to data file */ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fflush(fp1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fflush(fp2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fflush(fp3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;fflush(fp4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;/* plot graph */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;PlotOne();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;usleep(250); /* sleep for short time */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void quit()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;{&lt;span style=""&gt;  &lt;/span&gt;printf("\nctrl-c caught:\n Shutting down pipes\n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;StopPlot();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;printf("closing data files\n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fclose(fp1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fclose(fp2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fclose(fp3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fclose(fp4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;printf("deleting data files\n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;RemoveDat();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The plotter.c module is as follows: &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* plotter.c module */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* contains routines to plot a data file produced by another program&lt;span style=""&gt;  &lt;/span&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* 2d data plotted in this version&lt;span style=""&gt;                                    &lt;/span&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/**********************************************************************/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include "externals.h"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static FILE *plot1,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;*plot2,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;*ashell;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *startplot1 = "plot [] [0:1.1]'plot11.dat' with lines, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;'plot12.dat' with lines\n";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *startplot2 = "plot 'plot21.dat' with lines, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;'plot22.dat' with lines\n";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *replot = "replot\n";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *command1= "/usr/local/bin/gnuplot&amp;gt; dump1";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *command2= "/usr/local/bin/gnuplot&amp;gt; dump2";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *deletefiles = "rm plot11.dat plot12.dat plot21.dat plot22.dat";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;static char *set_term = "set terminal x11\n";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;StartPlot(void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;{ plot1 = popen(command1, "w");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fprintf(plot1, "%s", set_term);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fflush(plot1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;if (plot1 == NULL)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;exit(2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;plot2 = popen(command2, "w");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fprintf(plot2, "%s", set_term);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fflush(plot2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;if (plot2 == NULL)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;exit(2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;RemoveDat(void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;{ ashell = popen(deletefiles, "w");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;exit(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;StopPlot(void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;{ pclose(plot1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;pclose(plot2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;PlotOne(void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;{ fprintf(plot1, "%s", startplot1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fflush(plot1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fprintf(plot2, "%s", startplot2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fflush(plot2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;RePlot(void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;{ fprintf(plot1, "%s", replot);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;fflush(plot1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;The header file externals.h contains the following: &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* externals.h */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#ifndef EXTERNALS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#define EXTERNALS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include &amp;lt;stdio.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include &amp;lt;stdlib.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#include &amp;lt;math.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;/* prototypes */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void StartPlot(void);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void RemoveDat(void);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void StopPlot(void);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void PlotOne(void);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;void RePlot(void);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;#endif&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="SECTION002340000000000000000"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Exercises&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Exercise 12733&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal; color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:&amp;quot;;font-size:130%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Setup a two-way pipe between parent and child processes in a C program. i.e. both can send and receive signals. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-8785882192197521592?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/8785882192197521592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=8785882192197521592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8785882192197521592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/8785882192197521592'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/interprocess-communication-ipc-pipes.html' title='Interprocess Communication (IPC), Pipes'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-6391774922603151266</id><published>2008-10-07T23:53:00.000-07:00</published><updated>2008-10-07T23:54:22.881-07:00</updated><title type='text'>Program to print the odd numbers by parent process &amp; even numbers by       child process.</title><content type='html'>#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int array[10],pid,i=0;&lt;br /&gt;&lt;br /&gt;    printf("Enter 10 numbers : ");&lt;br /&gt;&lt;br /&gt;    while(i&amp;lt;10)&lt;br /&gt;    {&lt;br /&gt;        scanf("%d",&amp;array[i]);&lt;br /&gt;        i=i+1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    pid = fork();&lt;br /&gt;&lt;br /&gt;    if(pid == 0)&lt;br /&gt;    {&lt;br /&gt;        &lt;br /&gt;        printf("In child processn");&lt;br /&gt;        printf("Even numbers are : ");&lt;br /&gt;        i=0;&lt;br /&gt;&lt;br /&gt;        while(i&amp;lt;10)&lt;br /&gt;        {&lt;br /&gt;            if(array[i] % 2 == 0)&lt;br /&gt;                printf("%d",array[i]);&lt;br /&gt;            i++;&lt;br /&gt;        }   &lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    else if(pid&amp;gt;0)&lt;br /&gt;    {&lt;br /&gt;        printf("nIn parent processn");&lt;br /&gt;        printf(Odd numbers are : ");&lt;br /&gt;        i=0;&lt;br /&gt;        &lt;br /&gt;        while(i&amp;lt;0)&lt;br /&gt;        {&lt;br /&gt;            if(array[i] % 2 != /0)&lt;br /&gt;                printf("%d ",array[i]);&lt;br /&gt;            i++;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-6391774922603151266?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/6391774922603151266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=6391774922603151266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/6391774922603151266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/6391774922603151266'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/program-to-print-odd-numbers-by-parent.html' title='Program to print the odd numbers by parent process &amp; even numbers by       child process.'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-322475355182216455</id><published>2008-10-07T23:51:00.000-07:00</published><updated>2008-10-07T23:52:13.720-07:00</updated><title type='text'>Use fork() system call to create a child process &amp; print the ids of parent &amp;       child.</title><content type='html'>#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int pid;&lt;br /&gt;    pid = fork();&lt;br /&gt;    if(pid==0)&lt;br /&gt;        printf("Process id of child process : %d",getpid());&lt;br /&gt;    else if(pid&amp;gt;0)&lt;br /&gt;        printf("Process id of parent process : %d",getpid());&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-322475355182216455?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/322475355182216455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=322475355182216455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/322475355182216455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/322475355182216455'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/use-fork-system-call-to-create-child.html' title='Use fork() system call to create a child process &amp; print the ids of parent &amp;       child.'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-3947630236206397775</id><published>2008-10-07T23:49:00.000-07:00</published><updated>2008-10-07T23:50:45.522-07:00</updated><title type='text'>Program to create a file ' Student.txt '. Enter the details(name,Id,Marks) of 5       students. Write the data into the file &amp; display it.</title><content type='html'>#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include&amp;lt;fcntl.h&amp;gt;&lt;br /&gt;#include&amp;lt;string.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int fd,i;&lt;br /&gt;    char marks[5] , id[4] , name[30] , ch[2];&lt;br /&gt;    fd = open("student.txt" , O_CREAT | O_RDWR , 0777);&lt;br /&gt;    &lt;br /&gt;    for(i=0;i&amp;lt;5;i++)&lt;br /&gt;    {&lt;br /&gt;        printf(" \nEnter the details of student no. %d\n ",i+1);&lt;br /&gt;        &lt;br /&gt;        printf("\nEnter name : ");&lt;br /&gt;        scanf("%s",name);&lt;br /&gt;        write(fd,name,strlen(name));&lt;br /&gt;        write(fd,"\n",1);&lt;br /&gt;&lt;br /&gt;        printf("\nEnter id : ");&lt;br /&gt;        scanf("%s",id);&lt;br /&gt;        write(fd,id,strlen(id));&lt;br /&gt;        write(fd,"\n",1);&lt;br /&gt;&lt;br /&gt;        printf("nEnter total mark : ");&lt;br /&gt;        scanf("%s",marks);&lt;br /&gt;        write(fd,marks,strlen(marks));&lt;br /&gt;        write(fd,"\n",1);&lt;br /&gt;&lt;br /&gt;    } &lt;br /&gt;    &lt;br /&gt;    fd = open("student.txt",O_RDONLY);&lt;br /&gt;&lt;br /&gt;    for(i=0;i&amp;lt;5;i++)&lt;br /&gt;    {&lt;br /&gt;        c=-1;&lt;br /&gt;        do&lt;br /&gt;        {&lt;br /&gt;            c=c+1;&lt;br /&gt;            read(fd,ch,1);&lt;br /&gt;            name[c]=ch[0];&lt;br /&gt;        }while(ch[0]!='\n');&lt;br /&gt;    &lt;br /&gt;        name[c]='\0';&lt;br /&gt;        c=-1;&lt;br /&gt;&lt;br /&gt;        do&lt;br /&gt;        {&lt;br /&gt;            c=c+1;&lt;br /&gt;            read(fd,ch,1);&lt;br /&gt;            id[c]=ch[0];&lt;br /&gt;        }while(ch[0]!='\n');&lt;br /&gt;    &lt;br /&gt;        id[c]='\0';&lt;br /&gt;        c=-1;&lt;br /&gt;&lt;br /&gt;        do&lt;br /&gt;        {&lt;br /&gt;            c=c+1;&lt;br /&gt;            read(fd,ch,1);&lt;br /&gt;            marks[c]=ch[0];&lt;br /&gt;        }while(ch[0]!='\n');&lt;br /&gt;    &lt;br /&gt;        marks[c]='\0';&lt;br /&gt;&lt;br /&gt;        printf("Name : %s\nId : %s\nTotal marks : %s\n",name,id,marks);&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-3947630236206397775?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/3947630236206397775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=3947630236206397775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3947630236206397775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/3947630236206397775'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/program-to-create-file-studenttxt-enter.html' title='Program to create a file &apos; Student.txt &apos;. Enter the details(name,Id,Marks) of 5       students. Write the data into the file &amp; display it.'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-4129825759839823829</id><published>2008-10-07T23:46:00.000-07:00</published><updated>2008-10-07T23:48:52.465-07:00</updated><title type='text'>A program to find the sum of n numbers using cmdline arguements.       Write another program and use exec() system call to run the above program.</title><content type='html'>#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;stdlib.h&amp;gt;&lt;br /&gt; &lt;br /&gt;int main(int a, int *ip[ ])&lt;br /&gt;{&lt;br /&gt;                int sum=0;&lt;br /&gt;                while(a&amp;gt;1)&lt;br /&gt;{&lt;br /&gt;                sum = sum + atoi(ip[a-1]);&lt;br /&gt;                a--;&lt;br /&gt;}&lt;br /&gt;printf(“sum = %d”,sum);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;#include&amp;lt;unistd.h&amp;gt;&lt;br /&gt; &lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;                execl(“./sum.out”,” “ ,”1”,”2”,”3”,”4”,”5”,NULL);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-4129825759839823829?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/4129825759839823829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=4129825759839823829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4129825759839823829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/4129825759839823829'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/program-to-find-sum-of-n-numbers-using.html' title='A program to find the sum of n numbers using cmdline arguements.       Write another program and use exec() system call to run the above program.'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5759285407797891098.post-9033721867362735173</id><published>2008-10-07T23:44:00.000-07:00</published><updated>2008-10-18T22:05:56.067-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my unbuntu'/><title type='text'>My Ubuntu</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPq-Yjb2EeI/AAAAAAAAACc/pDT_wsJYYqo/s1600-h/Image01.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 552px; height: 413px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPq-Yjb2EeI/AAAAAAAAACc/pDT_wsJYYqo/s400/Image01.jpg" alt="" id="BLOGGER_PHOTO_ID_5258724843946643938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPq-YrDNh2I/AAAAAAAAACk/0l2Vl9KHTAo/s1600-h/Image02.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 560px; height: 420px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPq-YrDNh2I/AAAAAAAAACk/0l2Vl9KHTAo/s400/Image02.jpg" alt="" id="BLOGGER_PHOTO_ID_5258724845990807394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPq-Y-ngonI/AAAAAAAAACs/XtW6BYGzqQQ/s1600-h/Image03.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 555px; height: 414px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPq-Y-ngonI/AAAAAAAAACs/XtW6BYGzqQQ/s400/Image03.jpg" alt="" id="BLOGGER_PHOTO_ID_5258724851243328114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf1tO6pRAI/AAAAAAAAAAk/3KqBaglPZDU/s1600-h/Image00.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 507px; height: 378px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf1tO6pRAI/AAAAAAAAAAk/3KqBaglPZDU/s320/Image00.jpg" alt="" id="BLOGGER_PHOTO_ID_5257941247425332226" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1tGWTasI/AAAAAAAAAAs/5HkzfK4QSD0/s1600-h/Image01.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 507px; height: 380px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1tGWTasI/AAAAAAAAAAs/5HkzfK4QSD0/s320/Image01.jpg" alt="" id="BLOGGER_PHOTO_ID_5257941245125421762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1tdPOBbI/AAAAAAAAAA0/ZvIf2rH2UoQ/s1600-h/Image02.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 509px; height: 381px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1tdPOBbI/AAAAAAAAAA0/ZvIf2rH2UoQ/s320/Image02.jpg" alt="" id="BLOGGER_PHOTO_ID_5257941251269723570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1toqhf1I/AAAAAAAAAA8/sbcupIXAHBw/s1600-h/Image03.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 507px; height: 379px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf1toqhf1I/AAAAAAAAAA8/sbcupIXAHBw/s320/Image03.jpg" alt="" id="BLOGGER_PHOTO_ID_5257941254337036114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf1tpxrSYI/AAAAAAAAABE/e2aOYXFK0Rw/s1600-h/Image05.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 506px; height: 379px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf1tpxrSYI/AAAAAAAAABE/e2aOYXFK0Rw/s320/Image05.jpg" alt="" id="BLOGGER_PHOTO_ID_5257941254635473282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf4BcASoJI/AAAAAAAAAB0/kSmKHrcN3e8/s1600-h/Image11.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 506px; height: 379px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf4BcASoJI/AAAAAAAAAB0/kSmKHrcN3e8/s320/Image11.jpg" alt="" id="BLOGGER_PHOTO_ID_5257943793559314578" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf4BiMMR8I/AAAAAAAAAB8/j-_hueIWIN4/s1600-h/Image12.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 507px; height: 380px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf4BiMMR8I/AAAAAAAAAB8/j-_hueIWIN4/s320/Image12.jpg" alt="" id="BLOGGER_PHOTO_ID_5257943795219843010" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf4B3vHsAI/AAAAAAAAACE/-hIF-PtaAF4/s1600-h/Image13.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 507px; height: 380px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf4B3vHsAI/AAAAAAAAACE/-hIF-PtaAF4/s320/Image13.jpg" alt="" id="BLOGGER_PHOTO_ID_5257943801003487234" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf4B2QW7iI/AAAAAAAAACM/DpiwYjSLkO4/s1600-h/Image14.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 508px; height: 380px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf4B2QW7iI/AAAAAAAAACM/DpiwYjSLkO4/s320/Image14.jpg" alt="" id="BLOGGER_PHOTO_ID_5257943800606027298" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf4CJ75QzI/AAAAAAAAACU/2CRuFPonW0U/s1600-h/Image15.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 509px; height: 381px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf4CJ75QzI/AAAAAAAAACU/2CRuFPonW0U/s320/Image15.jpg" alt="" id="BLOGGER_PHOTO_ID_5257943805888906034" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf2v5KwqtI/AAAAAAAAABM/BAaFPUaMo1s/s1600-h/Image06.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 509px; height: 381px;" src="http://1.bp.blogspot.com/_Jz6jbQjPIno/SPf2v5KwqtI/AAAAAAAAABM/BAaFPUaMo1s/s320/Image06.jpg" alt="" id="BLOGGER_PHOTO_ID_5257942392638581458" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf2wPgxBAI/AAAAAAAAABU/4kY7Zmd2YTc/s1600-h/Image07.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 509px; height: 381px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf2wPgxBAI/AAAAAAAAABU/4kY7Zmd2YTc/s320/Image07.jpg" alt="" id="BLOGGER_PHOTO_ID_5257942398636459010" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf2wbBxxhI/AAAAAAAAABc/WuqDWkKZnT0/s1600-h/Image08.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 510px; height: 382px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf2wbBxxhI/AAAAAAAAABc/WuqDWkKZnT0/s320/Image08.jpg" alt="" id="BLOGGER_PHOTO_ID_5257942401727710738" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf2wf1lGKI/AAAAAAAAABk/PgeADbtu88M/s1600-h/Image09.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 510px; height: 382px;" src="http://4.bp.blogspot.com/_Jz6jbQjPIno/SPf2wf1lGKI/AAAAAAAAABk/PgeADbtu88M/s320/Image09.jpg" alt="" id="BLOGGER_PHOTO_ID_5257942403018725538" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf2wgLvoAI/AAAAAAAAABs/p3Q3rJUWMPY/s1600-h/Image10.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 510px; height: 382px;" src="http://3.bp.blogspot.com/_Jz6jbQjPIno/SPf2wgLvoAI/AAAAAAAAABs/p3Q3rJUWMPY/s320/Image10.jpg" alt="" id="BLOGGER_PHOTO_ID_5257942403111690242" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5759285407797891098-9033721867362735173?l=osandnetworklab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://osandnetworklab.blogspot.com/feeds/9033721867362735173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5759285407797891098&amp;postID=9033721867362735173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/9033721867362735173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5759285407797891098/posts/default/9033721867362735173'/><link rel='alternate' type='text/html' href='http://osandnetworklab.blogspot.com/2008/10/execl.html' title='My Ubuntu'/><author><name>Dipin Krishna</name><uri>http://www.blogger.com/profile/14172656519075948035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Jz6jbQjPIno/SPq-Yjb2EeI/AAAAAAAAACc/pDT_wsJYYqo/s72-c/Image01.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
