Sunday, May 25, 2014

TCP/IP (Transmission Control Protocol/Internet Protocol)


TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication language or protocol of the Internet. It can also be used as a communications protocol in a private network (either an intranet or an extranet).
TCP/IP is a two-layer program. The higher layer, Transmission Control Protocol, manages the assembling of a message or file into smaller packets that are transmitted over the Internet and received by a TCP layer that reassembles the packets into the original message.

The lower layer, Internet Protocol, handles the address part of each packet so that it gets to the right destination. Each gateway computer on the network checks this address to see where to forward the message. Even though some packets from the same message are routed differently than others, theyll be reassembled at the destination.

TCP/IP uses the client/server model of communication in which a computer user (a client) requests and is provided a service (such as sending a Web page) by another computer (a server) in the network. TCP/IP communication is primarily point-to-point, meaning each communication is from one point (or host computer) in the network to another point or host computer.


Reference

Thursday, May 15, 2014

What is a RS232 to RS485 converter?


The main differences between these RS232 to RS485 converter units are that some of them can have a DB9 connector whereas others have a terminal screw header or RJ11 connector, some are isolated some are not, some has more than one RS485 port, some has LED lights for indicating RX/TX data flow, some are port-powered and some needs an external power supply, some are industrial strength, some are consumer products.

The RS232 to RS485 itself, regardless of what model you choose, is simply a device which can convert standard RS232 data signals into RS485 signals and vice versa. Most RS232 to RS485 converters can convert data in both directions, from RS232 to RS485 and from RS485 to RS232, this is also called a bi-directional converter.


When should I use a RS232 to RS485 converter?

RS232 to RS485 converters are mostly used in industrial and commercial environments. The reason is that the RS485 converter can be used for multi-drop networks, meaning that you for example can connect multiple RS485 devices to one computer. Up to 32 devices can be connected in one network to communicate on a single pair of wires (plus a ground wire), and the number can even be increased by using RS485 repeaters. This type of communication is called half-duplex communication. Most quality RS485 converters can communicate in this manner of up to 4000 feet (1200 meters). The RS485 converter is also fairly resistant to noise which is one more reason why it is favored in industrial environments.
Examples of uses for a RS232 to RS485 converter could be for connecting cameras, scales, meters, scanners, PLCs or most other industrial equipment to a computer.


Connecting a RS232 to RS485 converter.

The RS232 to RS485 converter can be used for point-to-point connections (connecting one RS232 to RS485 converter directly to another RS232 to RS485 converter) and point-to-multipoint networks (connecting one RS232 to RS485 converter to multiple RS232 to RS485 converters.
In a RS485 network only one slave and one master can communicate at a time, either transmitting or receiving, but not at the same time, so you might wonder how this is accomplished. Simply speaking the slaves (also called nodes) must be addressed, for example node 1 has address 001, node 2 has address 002 and so forth. These addresses are usually assigned and controlled by software, either the software running at the RS485 master (PC), or software programmed in each of the slaves. Sometimes the equipment connected at the RS485 slaves is addressable by hardware instead of software. Finally, some RS232 to RS485 converters are addressable (by DIP switches) itself, this is however not used very often.



Source

Sunday, May 4, 2014

Interfacing the Serial / RS232 Port


The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial port will need the serial transmission converted back to parallel so that it can be used. This can be done using a UART. On the software side of things, there are many more registers that you have to attend to than on a Standard Parallel Port. (SPP)
So what are the advantages of using serial data transfer rather than parallel?

1.Serial Cables can be longer than Parallel cables. The serial port transmits a 1 as -3 to -25 volts and a 0 as +3 to +25 volts where as a parallel port transmits a 0 as 0v and a 1 as 5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for serial cables than they are for parallel.

2.You dont need as many wires than parallel transmission. If your device needs to be mounted a far distance away from the computer then 3 core cable (Null Modem Configuration) is going to be a lot cheaper that running 19 or 25 core cable. However you must take into account the cost of the interfacing at each end.

3.Infra Red devices have proven quite popular recently. You may of seen many electronic diaries and palmtop computers which have infra red capabilities build in. Therefore serial transmission is used where one bit is sent at a time. IrDA-1 (The first infra red specifications) was capable of 115.2k baud and was interfaced into a UART. The pulse length however was cut down to 3/16th of a RS232 bit length to conserve power considering these devices are mainly used on diaries, laptops and palmtops.

4.Microcontrollers have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces) which can be used to talk to the outside world. Serial Communication reduces the pin count of these MPUs. Only two pins are commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method (You may also require a Strobe).


**Reference**
http://iie.fing.edu.uy/~nantonie/Integrados-Componentes-Docs/PC/Conectores&Interfaces/RS232/RS232_5/serial.html

Monday, April 21, 2014

Micromanagement and Macromanagement



Micromanagers

In business management, micromanagement is a management style where a manager closely observes or controls the work of their employees, generally used as a pejorative term. In contrast to giving general instructions on smaller tasks while supervising larger concerns, the micromanager monitors and assesses every step.

Micromanagement may arise from internal sources, such as concern for details, increased performance pressure, or insecurity. It can also be seen as a tactic used by managers to eliminate unwanted employees, either by creating standards employees cannot meet leading to termination, or by creating a stressful workplace causing the employee to leave.

Regardless of the motivation the effect can de-motivate employees, create resentment, and damage trust. Micromanagement can also be distinguished from management by worker to boss ratio. When a boss can do a worker's job with more efficiency than giving the order to do the same job, this is micromanagement.

Micromanagers are managers that oversee their workers too closely. They are constantly looking over your shoulder, commenting positively or negatively. They tend to look at the details of an employees job many times during the work day, usually making unwarranted remarks.
The worker who is micromanaged will reason, "Why can't my boss just let me do my job and leave me alone? What mistakes are they looking for now?"

Micromanages will do compulsive overseeing with both good employees as well as those who are not performing well.

They engage the lowest frequency emotion, FEAR, in the workplace. Fear ----> frustration -----> Depression ---->Sabotage ----> Accidents ----->or Lack of Productivity. Too much micromanagement can cost a company its best and brightest.
This often taps into childhood issues for workers who had dictatorial parents and are now reliving that pain.

Remember that adulthood is often about moving past childhood traumas created in the first 20 years of one's life. In the 21st century we recognize issues, and hopefully deal with them, or else dwell in dysfunctional behavioral patterns, using them as a crutch to not function.
Micromanaging is a compulsive, behavioral disorder similar to other addictive patterns. People who micromanage generally do so because they feel unsure and self-doubting. Sometimes they are pressured by a supervisor above them.

Employees may see them as controlling, dictatorial, judgmental, critical, bureaucratic, snooping, and more.

Do you micromanage? If the answer is Yes and you wonder why no one has brought this to your attention, the obvious answer is that they are afraid of repercussions. Micromanager do not see the 'big picture' because they are too busy dictating font size and controlling everyone else's moves that it totally escapes you and your workers. They are probably not getting your job completed because they are doing everyone else's. They lose the respect of co-workers and fellow employees.

Micromanagers should seek out professional help, perhaps offered by their company. Seek out other fellow managers and discuss how they operate. Have group discussions with your employees to resolve issues.

Macromanagers

On the flip side, we have the Macromanagers.

For the most part they leave their employees with a lack of decision making, especially when the details of the job change and they need immediate assistance.

Employees need guidelines and someone to talk to if they have a problem. Macromanagers leave their employees too much on their own. As a result the lack of direction and input is so lacking that an employee wonders if they are doing the job correctly.

Macromanaging can lead to inefficiency on the part of employees in regards to time spend on the job, work completed, and who they seek out for answers.

A boss who takes on too many projects, moving from one to another, and is therefore not easy to reach for guidance by anyone as he have overextended his time, will never get any of the jobs done properly, will always consider his employees incompetent, and will have to waste company time and money correcting mistakes.

For the best efficiency, there must exist an ongoing communication between employer and employee, that is not dictatorial, but gets the job done in the most efficient way.

There are souls who are very efficient, who do not micromanage, but cannot tolerate the inefficiency of those they work with. Yet they often have to work with people who are not equipped to get the job done, or they just goof off all day playing on the computer, coming in late, leaving early, talking on the phone, gossiping in the office, flirting or having sex with co-workers, etc. Often the efficient employees has to complete or correct the work of the other person. That must be very frustrating.

This takes us to another archived article about firing employees who do not do their job efficiently.
Behavioral scientists propose the presence of three psychological states that could result in a highly motivated and productive worker. The worker must experience:

1. Meaningfulness or significance of their job
2. Responsibility for outcomes
3. Feedback on the work performed

Wise management never underestimates people's pride and dignity for work. Recognition goes a long way. When the environment is happy, work translates to play. Money matters but that's not all there is.

At the end of the day we have to wonder whose fault is it if things go wrong, an inefficient employer who micromanages or macromanages, or an efficient employee who is wrong for the job?

This is almost like balancing a marriage or friendship!

What is HTTP




- HTTP stands for HyperText Transfer Protocol. It is the system for transmitting and receiving information across server and the client. The Server is the machine where your website code is placed and client is nothing but your browser. HTTP manages the mutual understanding between server and the client to exchange information or data successfully. The first HTTP had only one method called as GET, which would request a page from server and the response was a HTML page. The latest version of HTTP defines nine request methods.

- If you visit any website you may see the address gets prefixed with HTTP:// this means your browser is now connected to the server using HTTP. Now the HTTP isn’t the safest way to establish a connection, the problem with http though is that it is vulnerable to people who might want to eavesdrop or see what your activity is all about.


- HTTPS or Secure HTTP some may call it is a combination of Hypertext Transfer Protocol (HTTP) with SSL/TLS protocol. Now everything you communicate over HTTPS will be sent and received in encrypted form, which adds the element of safety.

- As when a client makes a request to the server, the server responds by offering a list of encryption methods. When the client connects to a website via HTTPS, the website encrypts the session with a digital certificate. Secure Sockets Layer or SSL uses a cryptographic system that encrypts data with two keys that is browser and server send each other unique codes which are used for encryption for rest of the talk.

- Https is used in many situations, such as log-in pages for banking, forms, corporate logins, and other applications in which data needs to be secured. It is always advised to never enter credit card details on websites that run on HTTP.


**The Differences between HTTP & HTTPS**

1) In case of HTTP URL begins with “HTTP://” and for HTTPS connection it is “HTTPS://”

2) HTTP is unsecured on other hand HTTPS is secured.

3) HTTP uses port 80 for communication unlike HTTPS which uses port 443

4) No certificates required for validation in case of HTTP. HTTPS requires SSL Digital Certificate

5) No encryption in HTTP; Data encrypted before sending and receiving in HTTPS.



**Reference**
http://www.thewindowsclub.com/difference-http-https

What is SQL Injection?


Is a technique in which an attacker inserts malicious code into strings that are later passed to a database for execution.

It exploits applications that formulate SQL statements from user input. Why would someone attempt SQL Injection?

-Obtain and Delete/Change information you have in your database.

-Cause denial of service (DoS) by injecting SQL that takes a long time to run and perhaps lock rows in your database.

Defending Against SQL Injection Attacks:
-Comprehensive data sanitization. 

Web sites must filter all user input.
Example: e-mail addresses should be filtered to allow only the characters allowed in an e-mail address and so on.

-Use a web application firewall. Example ModSecurity that provides a
filter to potentially dangerous web requests. Its SQL injection defenses
can catch most attempts to sneak SQL through web channels.

-Limit database privileges by context. Example, the code behind a login
page should query the database using an account limited only.

-Avoid Disclosing Error Information. Use structured exception handling to catch errors and prevent them from propagating back to the client. Log detailed error information locally, & return limited error to client.

Any one of these defenses significantly reduces the chances of a successful SQL injection attack. Although there is no such thing as a 100% guarantee in network security, formidable obstacles can be placed in the path of SQL injection attempts.


Refference:
-SQL Injection Explained :
http://www.youtube.com/watch?v=PB7hWlqTSqs
-How to Prevent SQL Injection :
http://www.esecurityplanet.com/hackers/how-to-prevent-sql-injection-attacks.html
-How to Protect From SQL Injection in ASP.NET :
http://msdn.microsoft.com/en-us/library/ff648339.aspx