<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; ece.harpreet</title>
	<atom:link href="https://www.emblogic.com/blog/author/ece-harpreet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>A FTP, client-server and networking based Project</title>
		<link>https://www.emblogic.com/blog/02/a-ftp-client-server-and-networking-based-project/</link>
		<comments>https://www.emblogic.com/blog/02/a-ftp-client-server-and-networking-based-project/#comments</comments>
		<pubDate>Wed, 26 Feb 2014 17:51:56 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Project 04: FTP based Client Server using Threads and Sockets]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8631</guid>
		<description><![CDATA[PROJECT TITLE : FTP based Client Server project using sockets and threads: Abstract: File Transfer Protocol is a standard network protocol used to transfer files from one host to another host over a TCP based network such as internet. This &#8230; <a href="https://www.emblogic.com/blog/02/a-ftp-client-server-and-networking-based-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>PROJECT TITLE :</p>
<p><strong>FTP based Client Server project using sockets and threads:</strong></p>
<p><strong>Abstract:</strong><br />
File Transfer Protocol is a standard network protocol used to transfer files from one host to another host over a TCP based network such as internet. This protocol can be used to upload or download files form one host to another. This protocol is based on cilent-server architecture and may use different control and data connections between the client and the server.<br />
I tried to implement FTP to transfer files within and over the network(using internet) using C language.</p>
<p><strong>Architecture:</strong><br />
There may be a server running and waiting for clients to log in(initiate communication). Once any client approaches the server to upload a file, it waits in a queue untill server accepts its request. The server may ask the client to login before further processing its request. Also the server may ask few times for correct password and failing to get that server may refuse to connect to that client.</p>
<p><strong>Implementation:</strong></p>
<p>SERVER-SIDE:<br />
1. I implemented server and used socket() system call to make a socket on the server side.<br />
This call makes a socket in the namespace(address family) but it has no address is assigned to it.<br />
And it also provides mechanisms to communicate with network layer.<br />
2. Then i named that socket using bind() system call.<br />
This system call assignes the address specified by one of its arguments to the socket referred to by<br />
file_descriptor returned by socket().<br />
3. Then i used listen() system call, which implements a listening queue to take requests from various clients to be processed by the server.<br />
4. Finally i used accept() system call to take requests from listening queue and implemented authentication functionality to provide access to the clients.<br />
5. If clients enters correct credentials if may proceed to upload a file.<br />
6. After getting the file server may proceed to handle another request from listening queue.</p>
<p>NOTE: I used accept() in a &#8216;forever&#8217; loop so that server may be running all the time.<br />
Once the client is successfully logged-in i implemented POSIX threads to take the any number of files(tested for 1000 files) fron that specific client.</p>
<p>CLIENT-SIDE:<br />
1. I implemented client and used socket() system call to make a socket on the client side.<br />
2. Then, i used connect() system call to send request to the server.<br />
3. Now when server is ready to accept the request then client is promped to enter its details along with passwords.<br />
4. Once the authentication is successfully done then client may send any number of files to the server in one go.<br />
5. After successfully sending file client may terminate or re-request the server to send more files.</p>
<p>The above algorithm was implemented and tested using AF_INET (address family) to transfer file within a private network.<br />
File can also be sent over the internet using the above algorithm but for that we may need to acquire the public ip address assigned to us.<br />
Another method is to use a technique referred to as &#8220;<em>PORT FORWARDING</em>&#8220;.<br />
This technique is only to be used at server&#8217;s side and it requires us to configure our router so that it may direct the incomming packets for a particular port address on server&#8217;s ip address.</p>
<p>Future scope:<br />
If we are not allowed to change router&#8217;s configuration then we can establish a VPN, which is used to directly communicate with a particular machine without even going through the router associated with that machine.</p>
<p>Thank You<br />
HARPREET SINGH<br />
ece.harpreetsingh@gmail.com</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/a-ftp-client-server-and-networking-based-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project 01: A C Programming and Data Structures based Project</title>
		<link>https://www.emblogic.com/blog/12/project-01-a-c-programming-and-data-structures-based-project/</link>
		<comments>https://www.emblogic.com/blog/12/project-01-a-c-programming-and-data-structures-based-project/#comments</comments>
		<pubDate>Sat, 07 Dec 2013 12:26:20 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7710</guid>
		<description><![CDATA[PROJECT TITLE: Multiple Data Compression and Encryption using Iterative Technique. Abstract: In digital forms of data storage, data can be represented by patterns of 0s and 1s. The more the patterns the more data can be compressed. Text may be &#8230; <a href="https://www.emblogic.com/blog/12/project-01-a-c-programming-and-data-structures-based-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>PROJECT TITLE:<br />
<strong>Multiple Data Compression and Encryption using Iterative Technique.<br />
</strong><br />
Abstract:</p>
<p>In digital forms of data storage, data can be represented by patterns of 0s and 1s.<br />
The more the patterns the more data can be compressed. Text may be compressed upto 40% of its original size. The percent of compression that can be done on a piece of text or a file depends on the type of file and the format of the text used.<br />
Compression of a file may not be useful un till it can be decompressed back to its original form for further usage.</p>
<p>The requirement of compressing a file arises form various reasons, some of which may be<br />
:<br />
1. Security purpose.<br />
2. Transmission purpose.(better bit rates, small latencies, etc)<br />
3. Secrecy of the data or file being transferred.(Only some people may access, understand and manipulate data that is visible to all)<br />
4. Storage purpose.(Efficient use of storage space)<br />
etc,</p>
<p>When a file is compressed using any algorithm, it may be decompressed using more or less of that same algorithm in reverse order. An efficient compression may only be tested upon successful decompression of the compressed file if it generates the original file as it was before compression.<br />
General Idea.<br />
Any text file that has some text in it must be compressed depending on the size of the file and distinct characters it have. The same file may be decompressed using suitable algorithm and it must generate a file having same information of the source file used for compression. The program must be able to find number of distinct characters in the text file and store them in am array. In computer architecture (x86 machines) the data encoding scheme used to store, manipulate and transmit data is ASCII(American Standard Code for Information Interchange). It defines that maximum number of distinct characters available are 256 (i.e., 2^8). I used this very property of ASCII codes in my algorithm for compressing and decompressing files of any length but must have 256 distinct characters.</p>
<p><em>A simple algorithm used in compressing a text file may be :</em></p>
<p>1) Open a source file that comtains some text.(this file will be subjected to compression and decompression).<br />
2) Read first character from source file.<br />
3) Store first character in an array.<br />
3) Read a character from this source file.<br />
4) Compare the character with already existing character(s) in the array.<br />
        if the character matches with any character present in array goto step 4.<br />
        otherwise, modify the size of array by appending this character into it.<br />
<strong>NOTE :</strong> this array now will have all the distinct characters in the file. This is the &#8220;key&#8221; used to compress and decompress the source file.<br />
5) Now calculate the code length according to the number of elements in the master array. This is the actual size that my character must use in memory.<br />
6) Seek the file position of the opened file to its begining.<br />
7) Read a character from this file.<br />
8. Compare this character with the one&#8217;s in array.<br />
        if it is present in array then assign its array index into a variable with appropriate shifting and goto step 7.<br />
        otherwise goto step 7.<br />
<strong>NOTE:</strong> step 8 may differently handle the characters depending the code length and algorithm but the working principle is same.<br />
9) Save the newely available coded word(after shifting) in to a new file. This is the compressed file.<br />
10) Close all opened files.<br />
11) Exit.</p>
<p><em>A simple algorithm used in decompressing a text file may be :<br />
</em><br />
NOTE : I must have the &#8220;key&#8221; used in compression.(i.e., array holding distinct characters that were present in the source file)<br />
1) Open the compressed file.<br />
2) Read a character from this file.<br />
3) save the bits of this character in different variables with appropriate shifting.<br />
NOTE: step 3 may differently handle the character depending the code length and algorithm but the working principle is same.<br />
4) Save the new bytes(new variables) in a new file.<br />
5) goto step 2.<br />
6) close all the opened files.<br />
7) Exit.</p>
<p>Now to test the compression algorithm, compare the final newely created file&#8217;s information with that of original source file&#8217;s.</p>
<p>Conclusion:<br />
I used the above algorithm to successfully compress and decompress many source files having variable text lengths.</p>
<p>Thank You.<br />
HARPREET SINGH<br />
ece.harpreetsingh@gmail.com</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/project-01-a-c-programming-and-data-structures-based-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PROJECT 3 : A Linux System Programming using IPC.</title>
		<link>https://www.emblogic.com/blog/11/project-3-a-linux-system-programming-using-ipc/</link>
		<comments>https://www.emblogic.com/blog/11/project-3-a-linux-system-programming-using-ipc/#comments</comments>
		<pubDate>Fri, 29 Nov 2013 06:40:43 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7592</guid>
		<description><![CDATA[A Linux System Programming using IPC. Many times for any client-server set-up to work efficiently, there arises a problem to share data or resources among various processes that are running. IPC involves many communication and synchronization techniques used to achieve &#8230; <a href="https://www.emblogic.com/blog/11/project-3-a-linux-system-programming-using-ipc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>A Linux System Programming using IPC.<br />
</strong><br />
Many times for any client-server set-up to work efficiently, there arises a problem to share data or resources among various processes that are running.<br />
IPC involves many communication and synchronization techniques used to achieve this, within a network or may be over the network to send/recieve data between two or more running processes.(at transport layer using SOCKETS)</p>
<p>This project is implemented to achieve inter-process communication seemlessly, using various communication and synchronization techniques including PIPEs, FIFOs, MESSAGE QUEUES, SHARED MEMORY, SEMAPHORE and SIGNALS.</p>
<p><strong>General Idea:</strong><br />
There may be 1 server and many requesting clients and a few processing clients.<br />
Many requesting clients may send their requests to the server at any point of time and server maintains a database so as to recognize the request and invoke appropriate processing client to calculate the result of the query.<br />
Also server must send the results of the requests to the associated requesting clients without any loss of data.</p>
<p><strong>1.</strong><br />
In my first attempt i implemented 1 server that itself invokes 3 requesting clients using PIPEs and recieves various requests from them.<br />
After having the requests it invokes appropriate processing clients using another set of 3 processing PIPEs to process the requests and calculate respective results to be sent back to appropriate requesting clients.</p>
<p>Problems Encountered:<br />
1) There was a problem in synchronizing the mechanism.<br />
2) Block on read<br />
3) Block on write.</p>
<p>Remedy:<br />
I implemented signals to synchronize the mechanism.</p>
<p><strong>2.</strong><br />
Then to make requesting clients independent of the server i implemented FIFOs to take requests from various requesting clients and to provide them with appropriate results.<br />
I used 1 requesting FIFO to get all the requests from the requesting clients.<br />
After decoding the request server invokes appropriate processing clients to get the result using PIPEs.<br />
Then the server sends the results to the requesting clients by another FIFO.<br />
The requesting clients also sent their PIDs so as to be signaled by the server.</p>
<p>Problems encountered:<br />
1)Block on open.<br />
2)Block on read.<br />
3)Block on write.<br />
4)Synchronization.</p>
<p>Remedy:<br />
i implemented signals to sync the mechanism.</p>
<p><strong>3.</strong><br />
Then i implemented MESSAGE QUEUE to get the requests from the requesting clients and everything else was same.<br />
The requirement for synchronization was appreciately decreased as there was no need of the processes to be present all the time as was in the case of FIFOs.<br />
The reader or the writer can anytime access the MESSAGE QUEUE to read or write the data along with their PIDs.</p>
<p>Problems encountered in MESSAGE QUEUEs:<br />
1) Max size limited by data chunk of message queue.<br />
2) Max size of queue is also system limited..<br />
Remedy:<br />
I implemented SHARED MEMORY and SEMAPHORES to achieve synchronization.</p>
<p><strong>4.</strong><br />
Now i modified the above architecture and used SHARED MEMORY instead of resulting FIFOto achieve synchronization. Still sync was not apprecisble.<br />
Problem encountered:<br />
Synchronization while sending the results back to the requesting clients was not proper.</p>
<p>Remedy:<br />
Use semaphores.</p>
<p><strong>5.</strong><br />
Finally i implemented each of the above mentioned techniques to implement the project.<br />
The requesting clients used MESSAGE QUEUE to send the requests to the server.<br />
Server, after analysing the requests, invoked appropriate processing client to calculate the result.<br />
Then server used SHARED MEMORY to sent results back to the requesting clients.<br />
SEMAPHORES were implemented to synchronize shared memory access by various requesting clients.</p>
<p>Submitted By:<br />
HARPREET SINGH<br />
Batch no.:<br />
20.02.36</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/11/project-3-a-linux-system-programming-using-ipc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attendance:  batch 20.02.36</title>
		<link>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-3/</link>
		<comments>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-3/#comments</comments>
		<pubDate>Fri, 04 Oct 2013 19:28:10 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7287</guid>
		<description><![CDATA[4oct2013 (Friday) 1) Harpreet Singh :: 9:15 a.m. to 5:45 p.m. 2) Kamal :: 10:15 a.m. to 6:00 p.m. 3) Prabhjot Singh :: 10:45 a.m. to 5:45 p.m. 4) Rahul :: 11:00 a.m. to 6:05 p.m. 5) Rekha :: 10:45 &#8230; <a href="https://www.emblogic.com/blog/10/attendance-batch-20-02-36-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>4oct2013 (Friday)<br />
1) Harpreet Singh :: 9:15 a.m. to 5:45 p.m.<br />
2) Kamal          :: 10:15 a.m. to 6:00 p.m.<br />
3) Prabhjot Singh :: 10:45 a.m. to 5:45 p.m.<br />
4) Rahul          :: 11:00 a.m. to 6:05 p.m.<br />
5) Rekha          :: 10:45 a.m. to 6 :05 p.m.<br />
6) Puneet         :: 10:40 a.m. to 5:30 p.m.<br />
7) Abhishek       :: 10:40 a.m. to<br />
Total : 7</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attendance: batch 20.02.36</title>
		<link>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-2/</link>
		<comments>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-2/#comments</comments>
		<pubDate>Thu, 03 Oct 2013 18:38:42 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Harpreet sir]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7271</guid>
		<description><![CDATA[3 Oct 2013 (Thursday) 1) Kamal :: 10:15 a.m. to 6:45 p.m. 2) Abhishek :: 10:20 a.m. to 3) Puneet :: 10:20 a.m. to 5:20 p.m. 4) prabhjot Singh :: 10:50 a.m. to 6:45 p.m. 5) Rekha :: 10:30 a.m. &#8230; <a href="https://www.emblogic.com/blog/10/attendance-batch-20-02-36-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>3 Oct 2013 (Thursday)<br />
1) Kamal :: 10:15 a.m. to 6:45 p.m.<br />
2) Abhishek :: 10:20 a.m. to<br />
3) Puneet :: 10:20 a.m. to 5:20 p.m.<br />
4) prabhjot Singh :: 10:50 a.m. to 6:45 p.m.<br />
5) Rekha :: 10:30 a.m. to 6:20 p.m.<br />
6) Rahul :: 11:20 a.m. to 6:20 p.m.<br />
7) Harpreet Singh :: 10:10 a.m. to 6:45 p.m.<br />
total : 7</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/10/attendance-batch-20-02-36-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attendance: batch 20.02.36</title>
		<link>https://www.emblogic.com/blog/10/attendance-batch-20-02-36/</link>
		<comments>https://www.emblogic.com/blog/10/attendance-batch-20-02-36/#comments</comments>
		<pubDate>Tue, 01 Oct 2013 15:12:20 +0000</pubDate>
		<dc:creator><![CDATA[ece.harpreet]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Harpreet sir]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7220</guid>
		<description><![CDATA[1 October 2013 (Tuesday) NAME :: In time to Out time. 1) Rekha Yadav :: 11:00 a.m. to 6:30 p.m. 2) Rahul Singh :: 11:00 a.m. to 7:00 p.m. 3) Puneet S. Bist :: 11:30 a.m. to 6:00p.m. 4) abhishek &#8230; <a href="https://www.emblogic.com/blog/10/attendance-batch-20-02-36/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>1 October 2013 (Tuesday)<br />
NAME :: In time to Out time.<br />
1) Rekha Yadav :: 11:00 a.m. to 6:30 p.m.</p>
<p>2) Rahul Singh :: 11:00 a.m. to 7:00 p.m.</p>
<p>3) Puneet S. Bist :: 11:30 a.m. to 6:00p.m.</p>
<p>4) abhishek Bist :: 11:30 a.m. to 4:00 p.m.</p>
<p>5) Kamal :: 10:30 a.m. to 6:00 p.m.</p>
<p>6) Prabhjot Singh :: 10:45 a.m. to 6:00 p.m.</p>
<p>7) Harpreet Singh :: 11:10 a.m. to 6:00 p.m.</p>
<p>Total strength: 7.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/10/attendance-batch-20-02-36/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
