#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Networking Programming


    Can we send and receive data on different data rates using a single machine?
    If yes, then How?
    Kindly discuss.
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    Sounds like homework to me.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Dear Mitakeet

    Welcome back.
    Did you understand what I mean?

    Second
    How to print characters on the screen at two per second


    Feel free to ask
  6. #4
  7. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    What do you mean by 'different data rates'? You can have different speed NICs on a single machine, you can have several of the same speed NIC but transmit at different rates and you can send to different destinations at different rates using the same NIC.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  8. #5
  9. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,158
    Rep Power
    2222
    I didn't understand. The title suggests that you are talking about network communication; eg, via TCP/IP over Ethernet. Your talk of data rates is suggestive of baud rates, which would mean that you're talking about serial port communication.

    Could you please explain the question more fully? Supply supporting information. We should not answer your homework question for you, but if you supply us with the work you've done so far by explaining the reasoning behind your questions, then we should be more inclined to help -- it's the smell of the all-too-common situation of "do my work for me" that we may overreact to. And if this is for work or a personal project, then a fairly detailed description of what you're trying to do would help, though of course do not divulge information that would identify your company or jeopardize proprietary information.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    my name is Jawad Durrani.

    I am doing my final project in MS.

    The topic is "Simulate adaptive jitter buffer and study the behavior of AMR-WB in VoIP.

    I have following questions.

    Q1 Can we send and receive data on the same machine which is not connected to any network.

    Q2 How we will send and receive data on the same machine which is not connected to any network with different data rates.

    Q3 How we will create artificial network traffic.

    Q4 How we will create an array in which we store the sound clips.

    Q5 How we will create, send and receive a voice packet of 20ms.

    We will discuss them one by one.
    The questions what I am asking are the sub questions of these.

    I am using MatLab for my simulation. But no problem if you guide me in any language e.g. C/C++/VB.net.

    A part from these questions.
    How to print characters on the screen at two per second?

    I hope it would be sufficient for clarification.
    and I hope you people will help to pull me out.

    Still if you people are confused then feel free to ask.
  12. #7
  13. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Originally Posted by durani01
    Q1 Can we send and receive data on the same machine which is not connected to any network.
    Yes, it is called the loopback interface.

    Originally Posted by durani01
    How we will send and receive data on the same machine which is not connected to any network with different data rates.
    You could add delays in your send and receive loops.


    Originally Posted by durani01
    Q3 How we will create artificial network traffic.
    Depends on what kinda network you're talking about. I personally use a small program I wrote in C and also JMeter, depending on the application that I'm testing for loads.

    Originally Posted by durani01
    Q4 How we will create an array in which we store the sound clips.
    Depends on what language you are using. How good are you at programming and are you familiar with any programming languages at all?

    Originally Posted by durani01
    Q5 How we will create, send and receive a voice packet of 20ms.
    Again, what language can you program in? Also, what is your programming environment?

    Originally Posted by durani01
    A part from these questions.
    How to print characters on the screen at two per second?
    Use delay statements in your code. Again, depends on language and environment you're using
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Dear Scorpion

    Thank you very much for your reply.

    Kindly explain each answer in detail. if possible explain with example.

    I am using MatLab for my simulations.
    but it would be no problem if you explain in any language e.g. C/C++/VB.net

    If you don't have much time then we will discuss it one by one but with detail.
  16. #9
  17. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,384
    Rep Power
    1871
    > The topic is "Simulate adaptive jitter buffer and study the behavior of AMR-WB in VoIP.
    Since the goal is a simulation, why do you need 'real' networking?

    Isn't this just a case of
    T1 received 123 bytes
    T2 received 1230 bytes
    T3 received 456 bytes
    T4 received 652 bytes
    and so on.

    Using wireshark and an existing VoIP application (use google to find one for your machine), you'll get a general idea of packet sizes and intervals.
    So if you figure out that packet intervals are between 20mS and 100ms (these are Tmin and Tmax), and that packet sizes vary between 100 bytes and 10kbytes (these are Smin and Smax).

    But after that, all you need for your simulation is a means of generating intervals between Tmin and Tmax, and packet sizes between Smin and Smax, all of which you will have figured out from a bit of study on a real-world application.

    Make sure you choose the right random function, so you have a normal distribution. At other random intervals, you will change the above Xmin and Xmax values to simulate changes in network conditions (bandwidth and latency).

    It's a simulation - you fake everything within whatever parameters you think are reasonable.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Dear Mr. Saleem

    First of all thank you very much for your reply.

    Second I don't need real network.

    Yes you are right. Its simulation. I have to produce everything fake.

    I am going to use Windows Platform and MatLab for my simulations.

    I have no expertise on Linux or Wireshark.
    I have little knowledge about Linux and wireshark.
    Also I don't want to waste the time in making my expertise in other tools.

    Isn't this just a case of
    T1 received 123 bytes
    T2 received 1230 bytes
    T3 received 456 bytes
    T4 received 652 bytes
    and so on.
    I can't understand what does it means.

    Using wireshark and an existing VoIP application (use google to find one for your machine), you'll get a general idea of packet sizes and intervals.
    So if you figure out that packet intervals are between 20mS and 100ms (these are Tmin and Tmax), and that packet sizes vary between 100 bytes and 10kbytes (these are Smin and Smax).
    Kindly explain it as well.
  20. #11
  21. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    I think you are way out of your depth. C or C++ can certainly do what you need done (I have done exactly this a number of times to test intrusion detection systems), but there is a rather steep learning curve for most people in getting up-to-speed with C/C++ and another one for socket programming. You are going to be _way_ better off using some scripting language (like Perl, Python, etc.) to do the sorts of things you need. Besides, as Salem says, when it is all boiled down, you don't need C, C++ or sockets to accomplish your goal.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    How we will process a data with different data rates.
    e.g. 16kbps, 32kbps.

    How we will create, send and receive a voice packet of 20ms and size of 100 bytes.
  24. #13
  25. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    You really should get a programmer to join your team. What you are asking to do is rather trivial which is just more indication that you are in over your head.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw

IMN logo majestic logo threadwatch logo seochat tools logo