Thread: How to automatically perform a router reconnect

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    4

    How to automatically perform a router reconnect

    Ok guyz here is the problem.

    I have a router which is accessed from the browser. I also have to give the password before accessing the router. There is also an option for restarting the router from the browser menu.

    Ok now the problem is that the speed of my dsl connection changes every time i restart the router. sometimes there is little difference between the old and new speed other times the difference is very great.

    What i want is some sort of program,script,anything which automatically restarts the router and keeps doing it until i get the desired speed.

    I require some general guidance on where to get started.
    Books,links,tutorials,anything that would help.

    I have done some programming in C++ in console. made some very basic management systems and such trivial stuff.

    would appreciate immediate help.thks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Have you tried just doing a page refresh in your browser?

    DSL speeds are usually adaptive, meaning they go up and down as conditions vary. Even if you get a fast connect, you can't assume that it will remain at that level all the time, and maintain a low error count.

    This is what I get from my router status page

    Uptime: 10 days, 6:28:15
    DSL Type: G.992.1 annex A
    Channel mode: Interleave
    Maximum Bandwidth (Up/Down) [kbps/kbps]: 928 / 6,528
    Bandwidth (Up/Down) [kbps/kbps]: 448 / 6,400
    Data Transferred (Sent/Received) [kB/GB]: 0.00 / 2.91
    Output Power (Up/Down) [dBm]: 11.5 / 19.5
    Line Attenuation (Up/Down) [dB]: 23.0 / 39.5
    SN Margin (Up/Down) [dB]: 21.0 / 11.5
    Loss of Framing (Local/Remote): 0 / 0
    Loss of Signal (Local/Remote): 4 / 0
    Loss of Power (Local/Remote): 0 / 0
    Loss of Link (Remote): 0
    Error Seconds (Local/Remote): 65,538 / 0
    FEC Errors (Up/Down): 96 / 62,221
    CRC Errors (Up/Down): 13 / 384
    HEC Errors (Up/Down): 8 / NA


    Anyway, an easy way to script an answer would be to use something like
    cURL and libcurl
    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.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by code999 View Post
    Ok now the problem is that the speed of my dsl connection changes every time i restart the router. sometimes there is little difference between the old and new speed other times the difference is very great.

    First of all... is your modem part of your router or is it separate?

    When a DSL modem is training during startup (DSL light flashing) it is testing line conditions and other factors to determine it's best operating speed. This speed determination should remain as long as the modem is not given a reason to retrain. Even with retraining, your connection is still governed by your ISP's speed limits.

    Now, if the modem (part of your router or not) is giving you wildly varying speeds, it is very likely something is wrong... most likely with the modem itself or perhaps with your phone line.

    I was on DSL pretty much since it started in this area, and over several years my speeds never budged an inch.


    So, before you start writing code to pound hell out of your router looking for a 1% speed improvement that gives mostly halucenary benefits, maybe you should get your phone line provider to do some testing on your line...

    In the mean time, stop rebooting things... Visit Speedtest.net - The Global Broadband Speed Test a couple of times a day (not every 5 minutes) and track your speeds over a cople of weeks... If you are experiencing outages on a regular scale, call your service provider and get it fixed.

    Finally... be aware some ISPs (Bell Canada being the worst) actually throttle certain kinds of content on the internet, which will greatly affect speeds...

    Bell sued for throttling internet speeds - Technology & Science - CBC News

    Is there anything to be gained by repeatedly rebooting your modem/router?
    Unless you count having to replace it every 6 months as a good thing... no.
    Last edited by CommonTater; 07-12-2011 at 05:37 AM.

  4. #4
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    Quote Originally Posted by Salem View Post
    Have you tried just doing a page refresh in your browser?

    DSL speeds are usually adaptive, meaning they go up and down as conditions vary. Even if you get a fast connect, you can't assume that it will remain at that level all the time, and maintain a low error count.

    This is what I get from my router status page

    Uptime: 10 days, 6:28:15
    DSL Type: G.992.1 annex A
    Channel mode: Interleave
    Maximum Bandwidth (Up/Down) [kbps/kbps]: 928 / 6,528
    Bandwidth (Up/Down) [kbps/kbps]: 448 / 6,400
    Data Transferred (Sent/Received) [kB/GB]: 0.00 / 2.91
    Output Power (Up/Down) [dBm]: 11.5 / 19.5
    Line Attenuation (Up/Down) [dB]: 23.0 / 39.5
    SN Margin (Up/Down) [dB]: 21.0 / 11.5
    Loss of Framing (Local/Remote): 0 / 0
    Loss of Signal (Local/Remote): 4 / 0
    Loss of Power (Local/Remote): 0 / 0
    Loss of Link (Remote): 0
    Error Seconds (Local/Remote): 65,538 / 0
    FEC Errors (Up/Down): 96 / 62,221
    CRC Errors (Up/Down): 13 / 384
    HEC Errors (Up/Down): 8 / NA


    Anyway, an easy way to script an answer would be to use something like
    cURL and libcurl
    Yes,

    I have and unless i restart the router the speed doesn't change.

    there is no doubt that DSL speed doesn't remains constant but in between restarting router i have had speed difference as much 90%.

    and Plz dont say that i should contact my phone company. Its a miracle that i even have a DSL in the place where i live.

    As for the tool it looks like its a little over me.I mean sort of way above my level it looks like a sort of PRO tool.Anyway i will try it and post updates.

    Thks.

  5. #5
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    Quote Originally Posted by CommonTater View Post
    First of all... is your modem part of your router or is it separate?

    When a DSL modem is training during startup (DSL light flashing) it is testing line conditions and other factors to determine it's best operating speed. This speed determination should remain as long as the modem is not given a reason to retrain. Even with retraining, your connection is still governed by your ISP's speed limits.

    Now, if the modem (part of your router or not) is giving you wildly varying speeds, it is very likely something is wrong... most likely with the modem itself or perhaps with your phone line.

    I was on DSL pretty much since it started in this area, and over several years my speeds never budged an inch.


    So, before you start writing code to pound hell out of your router looking for a 1% speed improvement that gives mostly halucenary benefits, maybe you should get your phone line provider to do some testing on your line...

    In the mean time, stop rebooting things... Visit Speedtest.net - The Global Broadband Speed Test a couple of times a day (not every 5 minutes) and track your speeds over a cople of weeks... If you are experiencing outages on a regular scale, call your service provider and get it fixed.

    Finally... be aware some ISPs (Bell Canada being the worst) actually throttle certain kinds of content on the internet, which will greatly affect speeds...

    Bell sued for throttling internet speeds - Technology & Science - CBC News

    Is there anything to be gained by repeatedly rebooting your modem/router?
    Unless you count having to replace it every 6 months as a good thing... no.
    1.My Modem is part of the router not separate.

    2.Ya i know something is wrong with the phone line but as i said in my reply to the other guy.Its a miracle that i even have DSL in my area let alone getting quality DSL.

    3.The kind of improvement i can get from restarting router can be upto 90%.

    4.Yes i am experiencing regular outages.I had to pull strings just to get the DSL working so expecting that my phone company will provide quality DSL is out of the question.

    5.Yes if i do not repeatedly reboot my router i only get 10% of the speed for which i paid for.So i have everything to gain.I an aware that its gonna destroy the router but i have no choice.

    Plz guide me(in very very basic terms that how i can write code and get my problem solved),

    Thks.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I'll let the others climb into the code with you... but I would strongly suggest you rethink the whole thing. If you're paying for (for example) 5mbps and only getting about 1... drop down to a 1mbps plan... Don't be destroying your equipment trying to get something that's simply not going to happen. Also be aware that DSL modems constantly retrain and will self-adjust to most changes in line conditions.

    Like I said .... pound heck out of www.speetest.net/ compile enough test data to see A) if you are being throttled and B) if there are times of day/week when outages occur... then contact your phone company.

    What you are doing amounts to changing the tires because you don't like the color of the seats.

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Quote Originally Posted by CommonTater View Post
    I was on DSL pretty much since it started in this area, and over several years my speeds never budged an inch.
    That says you have a 'clean' line (one with little variation in the noise levels).

    If you happen to be unlucky and have a 'dirty' line, one where the noise levels vary signifigantly, then you have to reboot your router quite frequently. This noise is due to 'dry' joins, corroded line casings, physical damage, etc.

    IME routers only retrain to lower speeds; that is as spikes in the noise level occur the connection speed decreases to compensate, but the router does not reconnect a higher speed when the noise level returns to normal.
    This means that the longer your router is connected then the slower it becomes.

    I am less than 200m from a optic fiber feed RIM (Remote Integrated Multiplexer, a form of Pair Gain) and have 6mm copper (as opposed tho the standard 4mm) but can not get more than 1.7Mbit/sec. 5 years ago this was 3.5Mbit/sec.

    The fault is under my neighbours lawn and when he mows the lawn my ADSL disconnects.

    There is no way to get this fixed (I have spent years trying), short of me committing a federal crime and breaking half a dozen peoples phone lines beyond repair.
    Last edited by novacain; 07-12-2011 at 07:48 PM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by novacain View Post
    IME routers only retrain to lower speeds; that is as spikes in the noise level occur the connection speed decreases to compensate, but the router does not reconnect a higher speed when the noise level returns to normal.
    This means that the longer your router is connected then the slower it becomes.
    While I did know about retraining, I didn't know they won't "retrain up"... that sucks. A bad design if ever there was one.

    The fault is under my neighbours lawn and when he mows the lawn my ADSL disconnects.
    Now THAT massively sucks...

    There is no way to get this fixed (I have spent years trying), short of me committing a federal crime and breaking half a dozen peoples phone lines beyond repair.
    Or... breaking his lawn mower beyond repair....


    Back in the beginning of June, a contractor doing cement work on the platforms of local "bell boxes" managed to cut 114 individual phone lines running into my neighborhood, including a mid-sized apartment building next door. They've managed only a partical restoration of service and will have to find and replace every line from that trunk to complete the full restoration. They got my DSL fixed almost right away but it never worked right after, so the family and I made the decision to "go cable" and boy oh boy are we glad we did that... The phone is clearer, the internet is faster and the whole thing is less expensive... Not having a television in the house, we never would have considered it otherwise.

  9. #9
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    guyz

    i have tried the tool thing that above guy mentioned and i cant even get started.plz need some more help.some book,tutorial anything else plz help.

    I don't even know where to get started on this thing.

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well to talk to my router using curl, I used
    Code:
    curl --cookie-jar t1.txt --user admin:NotMyRealPassword http://192.168.1.1/
    curl --cookie t1.txt --user admin:NotMyRealPassword http://192.168.1.1/
    The first one fails, but returns a session cookie.
    After that, I can use any URL on the router.

    If you have URLs for connect / disconnect, then perhaps they'll work for you.

    You might want to check your ISP's Terms Of Service.
    Say for example, your activity eats up the entire pool of dynamic IP addresses, but doesn't immediately release them (for some reason).
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting a button to perform a function
    By ineedmunchies in forum Windows Programming
    Replies: 6
    Last Post: 04-25-2010, 08:56 AM
  2. PPP reconnect
    By sailwind in forum Windows Programming
    Replies: 0
    Last Post: 07-02-2008, 11:50 PM
  3. To perform operations with Directory
    By shwetha_siddu in forum C Programming
    Replies: 16
    Last Post: 04-30-2008, 02:19 AM
  4. perform numeric integration
    By Frank_Rye in forum C Programming
    Replies: 5
    Last Post: 10-18-2005, 01:17 PM
  5. how do I perform an action over and over...
    By Rune Hunter in forum C# Programming
    Replies: 16
    Last Post: 02-25-2005, 11:03 AM