Subscribe by Email


Showing posts with label Persistent. Show all posts
Showing posts with label Persistent. Show all posts

Sunday, July 7, 2013

Differentiate between persistent and non-persistent CSMA?

- CSMA or Carrier Sense Multiple Access makes use of LBT or listen before technique before making any transmission. 
- It senses the channel for its status and if found free or idle, the data frames are transmitted otherwise the transmission is deferred till the channel becomes idle again. 
- In simple words, we can say that CSMA is an analogy to human behavior of not interrupting others when busy. 
- There are number of protocols out which the persistent and the non – persistent are the major ones. 
- CSMA is based on the idea that if the state of the channel can be listened or sensed prior to transmitting a packet, better throughput can be achieved.
- Also, using this methodology a number of collisions can be avoided. 
- However, it is necessary to make the following assumptions in CSMA technology:
  1. The length of the packets is constant.
  2. The errors can only be caused by collisions except which there are no errors.
  3. Capture effect is absent.
  4. The transmissions made by all the other hosts can be sensed by each of the hosts.
  5. The transmission time is always greater than the propagation delay.
About Persistent CSMA
- This protocol first senses the transmission channel and acts accordingly. 
- If the channel is found to be occupied by some other transmission, it keeps listening or sensing the channel and as soon as the channel becomes free or idle, starts its transmission. 
- On the other hand, if the channel is found empty, then it does not wait and starts transmitting immediately. 
- There are possibilities of collisions. 
- If one occurs, the transmitter must wait for random time duration and start again with the transmission. 
- It has a type called 1 – persistent protocol which makes transmission of probability 1 whenever the channel is idle. 
- In persistent CSMA there are possibilities of occurrence of collisions even if the propagation delay is 0. 
- However, collisions can only be avoided if the stations do not act so greedy. 
We can say that this CSMA protocol is aggressive and selfish. 
- There is another type of this protocol called the P – persistent CSMA. 
This is the most optimal strategy. 
- Here the channels are assumed to be slotted where one slot equals the period of contention i.e., 1 RTT delay. 
- The protocol has been named so because it transmits the packet with probability p if the channel is idle otherwise it waits for one slot and then transmits.

About Non–Persistent CSMA
- It is deferential and less aggressive when compared to its persistent counterpart. 
- It senses the channel and if it is busy it just waits and then again after sometime senses the channel unlike persistent CSMA which keeps on sensing the channel continuously. 
- As and when the channel is found free, the data packet is transmitted immediately. 
- If there occurs a collision it waits and starts again.
- In this protocol, even if the two stations become greedy in midst of transmission of some other station they do not collide probably whereas, in persistent CSMA they collide.
- Also, if only one of the stations become greedy in midst of some other transmission in progress, it has no choice but to wait. 
- In persistent CSMA this greedy stations takes over the channel up on completion of the current transmission.
Using non – persistent CSMA can reduce the number of collisions whereas persistent CSMA only increases the risk. 
- But the non – persistent CSMA is less efficient when compared to the persistent CSMA.
- Efficiency lies in the ability of the protocols of detecting the collisions before starting the transmission. 


Tuesday, January 17, 2012

What are different aspects of web site cookie testing?

In the last post, we already discussed what a cookie is and how and when they are used. So let us explore a little more about these cookies. Here we are going to discuss how the websites that use cookies are tested.

Disabling the cookie



Disabling the cookie feature is perhaps the easiest concept under website cookie testing. Disabling the cookies is the first step in web site cookie testing.

- How the turning off or disabling of the cookies does affects a web site? You can check out by yourself.

- Clean up all the cookies and close all the open browser windows of the site that is to be tested.

- When you close the browser windows, the session cookies are automatically deleted.

- Keep the cookie folder open while you are browsing the site.

- You have to close the browser in order to delete all the cookies.

- You will notice that as you close the browser, the session cookies are automatically deleted.

- Now you disable the cookies and try using the features of the website.

- You will observe that most of the features do not work since the cookies have been disabled.

- So we can conclude that the disabling the cookies, disables the functionality of the web site.

To use the website, the cookies must be enabled.
- The question here worth asking is that whether or not the server of that website is able to recognize its failure while attempting to set the cookies?

- And if it is recognizing also, does it send a notification or a message to user stating that the cookies must be enable in order for that web site to work?

- If this is not the case then the user will keep on trying to use the web site and will get frustrated without knowing that why the web site is not responding.

Amazon.com is one of the websites that work well even without the cookies. In such kind of web sites, the maintenance of the state if taken care of by the server side on the basis of the session ID stated at the end of the URL of the home page.

The URL of the home page of the web site was:
www.amazon.com/…/home.html/104-0233809-0567844

- The rightmost digit was changed from 4 to 5 and reposted in the URL.

- Amazon discards the edited URL and effectively recovers from the URL corruption by creating a URL with the help of a new session ID:
www.amazon.com/…/home.html/107-0357660-1139507

- From the above observation we conclude that the above hypothesis is correct.

To understand the test cases you need to understand how the cookies work and how they are stored and how the cookie settings can be edited? Here we are going to list some test cases for web site cookie testing:


- In concern to your privacy, the cookie privacy policy takes care that your personal data is not stored or used by the cookie.

- If no, then the cookie will save your sensitive data in an encrypted format.

- Always make sure that there is no over usage of cookies on the web site under test.This can annoy the users since the browser will prompt for cookies more often and this can cause a decline in the site traffic.

- If the site under test makes use of cookies, then it will not function properly on the disabling of cookies. Try to navigate through the website and use the features. But, make sure that the web site does not crash.

- Corruption of cookies
Change the values of the cookies to some vague values by editing them in note pad. You may later the contents of the cookie or change the parameters and observer the behavior of the website.


Monday, January 16, 2012

What are cookies and its types? Where are cookies used?

A cookie or an HTTP cookie can be defined as a message used by an origin website to send the information about the state to the browser of the user and by the browser to send the information about its state to the origin site.

An HTTP cookie is known by many names such as web cookie, browser cookie etc.

The information of the state that is sent across the origin site and the user’s browser is used for the purpose of:

- Authentication
- Identification of the session of an user
- Preferences of the user and
- Contents of the shopping cart

In other word HTTP cookies are used for any purpose that can be accomplished using the process storing text data on the computer of the user.

Characteristics and Uses of Cookie
- The main characteristic of Cookies is that they cannot be programmed and thus, cannot carry any kind of viruses or worms.

- Any malware cannot be installed on the host system with the use of a cookie. So they are safe to this extent.

- However, cookies can be effectively used by a spyware to track the browsing activities of the users.

- This is a major privacy concern and has prompted European and US law makers to take action in the past few years.

- Cookies are very easy to steal and are thus often misused by the hackers.

- Hackers steal the cookies and use them to gain access to the web account of the victim.

- Cookies were first used to solve the problem of implementation of the shopping cart.

- Initially the cookies were developed for the Netscape browser.

- They were used to check if the earlier visitors visited the site again.

- Later cookies were developed for internet explorer and other browsers.

- The concept of the cookies was not widely known to the public at that time.

The term “HTTP cookie” came into existence in the year of 1994. It has been derived from “magic cookie”.

What are Magic Cookies?
- Magic cookie was actually a data packet that a program receives and sends again to the program on the other side without altering the contents of the packet.

- Magic cookies were used in computing systems long back and were introduced in web communications by Lou Montulli in June 1994.


The development of a cookie for formal specifications is always in progress. Till date many types of cookies have developed. They have been discussed below:

Session cookie:
- This cookie has a lifetime equal to the time period of the user using the website.
- These cookies are automatically deleted after the end of a session.

Persistent cookie:
- These cookies last even after the session has expired.
- If a persistent cookie has its maximum age set to one year, then till the one year is over, the cookie will be sending information to the server every time the website is visited.
- These are also called tracking cookies.

Secure cookie:
- These cookies are used by the browser if it accessing server through an HTTPS connection.
- This ensures that the cookie is always encrypted during the transmission of the information.
- This prevents cookie theft.

HTTP only cookie:
- This type of cookie is mostly supported by all the modern browsers.
- On a browser which supports HTTP, an HTTP only cookie is used during transmission of HTTP requests.
- It restricts the access from other non HTTP scripts.

Third party cookie:
- The first party cookies are set with the same domain or sub domain in the address bar of the browser.
- But, third party cookies are set with various domains other than the one mentioned in the address bar.

Super cookie:
- A cookie with a public suffix domain like .co.uk, .com etc.

Zombie cookie:
- This cookie is automatically recreated after its deletion.


Facebook activity