Need help in Applying QOS to an ISP on ASR 1002

Hi
i want to ask 
if someone gave me CIR with 900Mbps internet upload & download
the question is being asked is.
when the congestion occurs ( when my bw is full)
where does the congestion occur ??
on my router ?
or ISP router ?
or the internet ?
or other place ???
that issue is deiving me mad , because im doing qos on my side to guarantee bw and shape  but it dont give me a result ?!
i mean , the qos is maching ok and soo nice
but ..... the performance.
agian
the performance as there is no guarantee and no bw guaranteed.
i asked an expert and told me you have to ask  your provider to do that thier side ?!!!  im really shocked to hear that ... he told me that congestion occurs outside my router.
so , im here to ask agian and agian.
what choices i have to fix my issue ??
wish to help
regards

Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
At "big speeds", there's a difference between shaping and policing.  However, generally within an ISP, policing is used to restrict bandwidth usage, of a customer, to some agreed upon CIR (when CIR is less than physical capacity).  With policing you don't need to manage any generated congestion (as over rate packets are just discarded).  Policing is also "lightweight" in its resource demands and is often directly supported by the hardware.
I do agree ISPs, that provide SLAs, avoid over subscription because otherwise SLAs might not be meet.  However, if SLAs are not provided, over subscription isn't uncommon.  If too much of the latter is done, customers may indeed change ISPs, but do they have a choice?  Or, how do the different ISP fees compare?  (ISPs do analyze customer impact, i.e. customer retention, with cost of providing the service.  They try to determine what's most profitable, not what the customer would like most.  [Do you have gig to your home yet?  If not, why not?  Is it because it cannot be technically done, or is cost and/or what other ISPs offer in the area a factor? (If you're lucky, maybe you have Google fiber, but even that might be a "loss leader".)])
BTW, at "big speeds", another reason shaping is avoided, and also why over subscription is avoided, is because of the needed queuing.  For example, say you wanted to queue up to 100 ms of traffic.  Well on a 100 Gbps link, that's 10 Gb of data.

Similar Messages

  • Need help setting up QOS on N900 router with PS4

    Hello all, I am looking to use the QOS settings on the N900 to secure my connection for gaming on PS4. I followed the indications in the link below, but instead of doing port forwarding, i enabled the QOS settings on all the ports used by the PS4. Is that how its supposed to work? Should i only do port forwarding to get my desired results?  Here are the instructions i followed: http://portforward.com/networking/static-ip-ps4/ Any help will be greatly appreciated!

    Hello mr Trancer, Thanks for taking the time to reply to my query, but i would dare say that this does not answer it however. I very well understand that port forwarding and QOS are different things. My question is: why is it that connection still fluctuates when i create a static IP on my PS4, then apply the QOS parameters to all the ports that the PS4 uses on that IP adress. I am not a wizz when it comes to that sort of thing, but those instructions are pretty clear, and the N900 router should be good enough to do it, so why doesnt it work? My internet connection speed is 30mbps and i have done the speed tests on those websites and they confirm im getting what i pay for, so this should work yet it doesnt. Any thoughts?

  • Need help on applying PSU 9 patch on Grid and Rac

    Hi Gurus,
    Oracle Version : 11.2.0.2
    Operating System : linux x_64
    Here we got p14841385_112020_GI_PSU9Linux-x86-64.zip from applying PSU 9 patch on our four node rac.
    Steps we follow.
    1.) Bringing DB instance 1 and AMS instance 1 down.
    2.) stoping Cluster on node 1 as root user
    (crsctl stop crs -n node1)
    3.) applying PUS patch.
    My doubt in read me file is
    •Case 1: Patching Oracle RAC or Oracle RAC One Node Database Homes and the GI Home Together
    •Case 2: Patching Oracle RAC or Oracle RAC One Node Database Homes
    •Case 3: Patching GI Home Alone
    •Case 4: Patching Oracle Restart Home
    •Case 5: Patching a Software Only GI Home Installation
    •Case 6: Patching a Software Only Oracle RAC or Oracle RAC One Node Home InstallationHere we in bit confussion which case we need consider case 3 or case 5.
    We are haing another PSU 9 patch for oracle also.
    Please help me how to proceed .
    Thanks & Regards,
    Venkata Poorna Prasad.S

    Hi Venkata,
    Case 3 you need to being down complete database as it will patch all node of the cluster by reading cluster configuration files from Grid Infrastructure.
    Case 5 you can patch each node locally keeping other cluster db nodes up
    Thanks,
    Ajay More
    http://www.moreajays.com

  • Need help with configuring QoS

    Hello,
    We are in the process of implementing MPLS for our WAN links so that we can run VoIP between 9 locations in the USA and I have lots of questions regarding how to configure QoS.
    We have a dedicated E1 connection to our headquarters in Germany. This location houses all of our SAP servers.
    In each location in the US, we will be using Avaya IP telephones and media gateways for voice communications. We also have some Polycom units in the field for video confererncing.
    How would I begin to configure QoS for these network connections.
    I was planning on using IP precedence or DSCP for marking the traffic and prioritizing as follows.
    Highest Priority: Voice and video
    2nd Highest: SAP and Oracle traffic
    Default priority: Lotus notes, www access
    Here are some questions that I have:
    1- For voice/video, which DSCP values or IP precedence values do I use?
    2- How do I assign voice/video to the LLQ queue?
    3- For SAP, what is the best way to mark the SAP traffic? From my understanding, SAP uses a variety of ports.
    4- For SAP and Oracle, should I use the CBWFQ queus? Is that preferable over other queues for this traffic?
    5- Should I make another classification of traffic for things like signaling for Voice and TFTP/FTP?
    6- If so for #5, what IP precedence/DSCP value(s) should I use and which queuing mechanism should I use?
    Thanks for the help in advance. At this point, you can probably tell that I am a newbie to QoS.
    Pete

    I can answer a few since i have a ton of avaya ip phones deployed.
    1)personally i leave both bearer and signaling in same queue at 46 (Diffserv) and 5 (COS) Video would be 40/4.
    2)sample config:
    class-map match-all voip-fr
    match ip dscp 46 (all traffic that have DSCP 46)
    class-map match-all vovid-fr
    match ip dscp 40(all traffic that have DSCP 40)
    policy-map llq
    class voip-fr
    priority 100 (Reserve 100Kbps priority bw for DSCP 46)
    class vovid-fr
    bandwidth 300 (Reserve 300Kbps non-priority bw for DSCP 40)
    class class-default
    fair-queue
    Serial Interface 0/0
    service-policy output llq (Apply policy map to voice and signaling
    traffic)
    5) nope. leave tftp and data in the default queue
    Also, since you are deploying Avaya IPT make sure you look at this document. great document i used.
    http://support.avaya.com/elmodocs2/comm_mgr/r3_1/pdfs/245600_4_2.pdf

  • Need help to apply filter in my query

    Hi,
    I have records of incidence in my table. These incidences have two types, one is normal incidence where I have incidence flag N and other is altered incidence where I have incidence flag Y. These incidences can have multiple status like 1. Cancelled 2. Closed 3. Open etc.
    A single incidence can have multiple plan to complete this and further this plan contains multiple activities.
    Now I have to apply a filter for my report, based on below conditions.
    I want to show all the records of incidences for normal incidence.
    exclude records for altered incidence where incidence status = Cancelled
    exclude records for altered incidence where status is closed and plan completion date is null
    exclude records for altered incidence where activity status = Cancelled
    Your help will be greatly appreciated.
    Thanks,
    Shantanu

    Hi, Shantanu,
    This does what you requested:
    SELECT    *
    FROM       table_x
    WHERE       incidence     = 'N'
    OR       (    status               != 1     -- Cancelled
           AND  (   status           != 2     -- Closed
                OR  completion_date     IS NOT NULL
           AND  activity_status          != 'Cancelled'
    ;Among other things, this assumes that status and activity_status are never NULL. If they can be NULL, the solution is a little messier, but only a little: instead of things like
    status   != 1you have to say
    NVL (status, 0)   != 1 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Need help setting up QoS on WRT160n V2

    Hello all,
    I have a particular issue that has baffled me for a bit.  I did the downgrade on this router to fix the stability issues that people have reported here.  However, the dilemna I find now is when I'm playing a game on my desktop (wired connection) it will work just great until I connect a laptop (wireless connection) on the router.  What will happen then, is that the wireless connection takes all the bandwidth.
    I read that I could enable QoS to set priority to certain connections or applications.  I logged into my router via 192.168.1.1 and tried to do this, but was unsuccessful.  I checked the user's guide and that was a pointless endeavor.  None of the fields match up to the user's guide.
    Can anyone help me set this up so my Desktop will take priority over any of the wireless devices I use on my network?
    Thanks!

    QoS onWRT160N v2 -
    Goto QoS tab - 
    Enable Internet Access Priority and under Category choose the option "Mac Address".You can type any name in the field "Enter a Name" and in "MAC Address" you have to type wireless mac address of your laptop and then under priority, either choose Normal or Low.Afetr doing these settings click on "Add" button and then click Save settings.

  • Need help in applying patch BP013 to OIM 9.0.1.2

    Hi,
    I am in th middle of applying patch BP013 to our OIM 9.0.1.2 environment. I am seeing an unusual behaviour. When I run the patch script patch_websphere.sh script, the xellerate application(Xellerate.ear) deployed in websphere is removed.
    when i log in to websphere admin console, under applications-->enterprise applications-->i am able to see only nexaweb. I cannot see Xellerate.
    I have not seen this behaviour earlier when I did patch upgrade BP011.
    If anybody is experiencing same issue then please suggest.
    Thanks,
    Kalpana.

    There is no error in patch_websphere.log file. I search the whole log file. But there is one error under /data/OIM/xellerate/logs/wsadmin-app-install-websphere.profile.log :
    ======
    Unable to install /data/OIM/xellerate/XellerateFull.ear
    com.ibm.ws.scripting.ScriptingException: com.ibm.websphere.management.application.client.AppDeploymentException: AppDeploymentException: [Unexpected exception.]
    org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException: IWAE0007E Could not load resource "META-INF/ibm-ejb-jar-bnd.xmi" in archive "xlBackOfficeBeans.jar"
    org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException: IWAE0007E Could not load resource "META-INF/ibm-ejb-jar-bnd.xmi" in archive "xlBackOfficeBeans.jar"
    ======
    I think it is because of this xeelerate application is not visible in websphere admin console. Please suggest.
    Thanks for your quick response.

  • Bought a new macbook and want to manually manage music onto my iphone 4s but when i click 'manually manage' and then 'apply' i get the message saying it will erase everything already on there. Need help please!

    Bought a new macbook and want to manually manage music onto my iphone 4s (as it is already full of music from old windows laptop) but when i click 'manually manage' and then 'apply' i get the message saying it will erase everything already on there. Need help please!

    Before you sync your iPhone make sure that all the music that was synced to your phonereviously has been copied to your iTunes on the new MacBook Pro. Then when you connect your phone you will be able to either sync all music or select only those playlists that you want on the phone.

  • I have a few songs that I purchased that either will not play or play for a minute and quit.  None of the suggestions in the Help section apply to me.  What do I need to do?

    I have a few songs that I purchased that either will not play or play for a minute and quit.  None of the suggestions in the Help section apply to my problem.  What do I need to do?

    hello, normally such issues are caused by a firewall/security software which doesn't recognize & therefore blocks new firefox versions. please try to remove all program rules for firefox in your firewall and let it detect the program again: [[Fix problems connecting to websites after updating Firefox]]

  • Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.

    Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.  I would prefer not to take my old Dell laptop and just be able to use my Ipad 2 via the wireless connection that the Airport Express creates.  However, I can configure the Airport Express at home prior to leaving if that is the best thing to do.

    I have a very similar problem with my AE! My MacBook, MacBook Pro & iPod Touch (1st Generation) all get a GREAT signal from our AE. BUT, our iPod Touch (2nd Generation) and new iPad (WiFi) get terrible signal strength unless we're right next to the AE!! Tech support at Apple is of no help! I'm ready to sell them all! This all started when we got the last OS update for iPod Touch/iPhone/iPad. So it must be a software issue not a hardware one..
    Any ideas?

  • Need help connecting to ISP through DSL/router

    Hi
    I need help configuring my intel solaris8 box to get to the internet. I have dsl going into a linksys router. my windows machine have no problem using the DNS servers from pacbell. i also have DNS setup on my novell server, but the solaris8 box still can't resolve anything. I can ping everyone on my segement, I can connect to my novell web server netscape navigator but can't resolve it's name, i have to use it's ip address. I can remote logon. I lloked for a resolv.conf file but can't find one, help!!!!
    Danny

    Edit /etc/resolv.conf (it may not exist) with the following lines:
    domain your.domain.name
    nameserver your.primary.dns.ip
    nameserver your.secondary.dns.ip
    search your.domain.suffix
    The last line is optional, but please do substitute those values for the ones that you use.
    As far as a default route goes, just edit /etc/defaultrouter (may not exist) and put the ip of your default gw on a single line.
    Alex

  • How to apply Qos in the precedence of cache server

    m in an isp  and iwant to apply the QOS to enhance my network internet performance
    actually i  have two requests , i will start with showing brief topology about my network and start asking the questions .
    here is the topology below :
    from the topology above , my access is only on R1 which is BGP internet gateway router and R2 is my ISP router.
    1- i want to apply Qos on R1 so that a subnet of 32 ips to have gurantee bandwidth of 30M .
    assume  the subnet  is 10.20.30.0/27  that need to be bw gurantee .
    2- i want the download traffic by idman or ftp on my Router R1 dont exceed 50 % of my total bw .
    i mean that i have 450M bandwith from my isp , & sometimes we have a  slow in browsing , so i want to enhance the browsing quality because  its more important that downloading files from internet.
    here is my two requests above , i dont know how it will work with the precedence of the cache server .
    anyway , i will paste my config of router and i will replace my puplic ips with xxx for privacy .
    7200Gateway#sh run
    Building configuration...
    Current configuration : 10149 bytes
    upgrade fpd auto
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    service password-encryption
    hostname 7200Gateway
    boot-start-marker
    boot-end-marker
    logging message-counter syslog
    logging buffered 50000
    enable secret xxxxxxxxxxxxxx
    no aaa new-model
    ip source-route
    ip wccp 80 redirect-list CACHE80
    ip wccp 90 redirect-list CACHE90
    ip cef
    no ip domain lookup
    ip accounting-threshold 4294967295
    login block-for 180 attempts 3 within 60
    login quiet-mode access-class telnet
    login on-failure log
    login on-success log
    no ipv6 cef
    multilink bundle-name authenticated
    username xxxxxx password xxxxx
    archive
    log config
      hidekeys
    interface GigabitEthernet0/1
    description LAN
    bandwidth 230000
    ip address 10.160.150.2 255.255.255.0
    ip wccp 80 redirect in
    ip policy route-map CACHE-REDIRECT
    load-interval 30
    duplex auto
    speed auto
    media-type rj45
    negotiation auto
    interface FastEthernet0/2
    no ip address
    shutdown
    duplex auto
    speed auto
    interface GigabitEthernet0/2
    description Cache
    bandwidth 150000
    ip address x.x.x.x 255.255.255.248
    ip wccp redirect exclude in
    load-interval 30
    duplex auto
    speed 1000
    media-type rj45
    negotiation auto
    interface GigabitEthernet0/3
    description Internet
    bandwidth 230000
    ip address x.x.x.x 255.255.255.252
    ip wccp 90 redirect in
    load-interval 30
    duplex full
    speed 1000
    media-type sfp
    negotiation auto
    router bgp zzzzzzz
    no synchronization
    bgp log-neighbor-changes
    network xxxx mask xxxxx
    network xxxx mask xxxx
    network xxxx mask xxxxx
    network xxxx mask xxxx
    network xxxx mask xxxxx
    network xxxx mask xxxx
    redistribute connected
    redistribute static
    neighbor zzzzzzzz remote-as zzzzzzz
    neighbor zzzzzzz password zzzzzzz
    neighbor zzzzzz route-map Pipo out
    no auto-summary
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 xxxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    ip route xxxxxxxx 255.255.0.0 xxxxxxxxxx
    no ip http server
    no ip http secure-server
    ip flow-top-talkers
    top 200
    sort-by bytes
    cache-timeout 5000
    ip access-list extended bb
    permit ip xxxx.xxxx.xx.0 0.0.1.255 any
    ip access-list extended CACHE80
    permit tcp xxxxxxx any eq www
    ip access-list extended CACHE90
    permit tcp any xxxxx.0 0.0.0.255
    ip access-list extended pipo
    permit ip xxxxx xxxxxxx any
      permit ip xxxxx xxxxxxx any
    ip access-list extended private
    permit tcp 172.16.0.0 0.0.255.255 any eq www
    permit ip 10.20.30.0 0.0.0.255 any
    ip access-list extended telnet
    permit ip xxxxxx xxxxxxx.255.255 any log
    permit ip xxxx xxxxx 0.0.0.255 any log
    ip prefix-list bb seq 5 permit xxxxx
    ip prefix-list bbseq 10 permit xxxxxx
    logging history size 500
    no cdp run
    route-map pipo permit 10
    match ip address prefix-list pipo1
    route-map pipo permit 20
    match ip address prefix-list newsubnet
    set metric 500
    set origin incomplete
    set as-path prepend xxxxxxxxx
    route-map permit 10
    match ip address prefix-list bibo
    route-map CACHE-REDIRECT permit 10
    match ip address  private
    set ip next-hop 1vvvvvv
    route-map CACHE-REDIRECT permit 20
    match ip address bibo e1
    set ip next-hop vvvvvv
    route-map CACHE-REDIRECT permit 30
    match ip address pipo
    set ip next-hop vvvvvvvvvv
    route-map CACHE-REDIRECT permit 100
    snmp-server community xxxxxx RO
    control-plane
    dial-peer cor custom
    line con 0
    password xxxxxxxx
    logging synchronous
    login
    stopbits 1
    line aux 0
    stopbits 1
    line vty 0 4
    exec-timeout 60 0
    password xxxxxxxxxxxxxxxxx
    logging synchronous
    login local
    end

    Hi Vinay,
    Please check the program. I have used the replace statement but it is not working.
    IF NOT v_sap_bom_rec IS INITIAL.
    Spliting the records at '~' delimiter
        SPLIT v_sap_bom_rec AT c_del INTO  wa_bom_file-model_name
                                           wa_bom_file-product_code
                                           wa_bom_file-description
                                           wa_bom_file-product_type
                                           wa_bom_file-mfg_part_num
                                           wa_bom_file-mfg_part_desc.
        REPLACE cl_abap_char_utilities=>horizontal_tab IN wa_bom_file-mfg_part_desc WITH space .
        wa_bom_file-status = c_status.
        APPEND wa_bom_file  TO i_bom_file.
    But it is not working.
    Please help me..
    Thanks
    Neelima

  • NEED HELP PLEASE Setting up 2 VLANS and a redundant WAN connection

    I have a remote branch office which is actually a huge bar/lounge. The bar wants to enable patrons to access the Internet with their wireless laptops. I want to prevent those patrons from accessing our private network, and also prevent them from traversing our static VPN tunnel back to HQ.
    The bar processes all credit cards via the T1 connection, and this has caused us to lose money every time the T1 goes down while we're open, since there is no WAN redundancy right now.
    Here is my current hardware configuration:
    1) one PIX 501 50-user 3des.
    2.) two Dell 3024
    3.) one Aironet 1100(g) AP.
    Current LAN Network: 10.35.35.0
    (internal employees only, static VPN tunneled to remote HQ network)
    Current Wireless SSID's:
    SSID1=PRIVATESSID
    SSID2=PUBLICSSID (not currently in use, waiting to figure this out)
    Current WAN: one T1 connection.
    WHAT I WOULD LIKE TO DO AND NEED HELP FIGURING OUT:
    #1a) I want to create two separate VLAN's that are able to share the WAN connection, but not be able to "see" each other.
    #1b) These VLAN's would be mapped to their respective SSID's on the AP (PRIVATESSID>10.35.35.0 and PUBLICSSID>192.168.1.0).
    #1c) The 192.168.1.0 network should not be able to traverse the static tunnel between the branch site and HQ.
    #2) I would like to install a backup WAN connection such as a modem 56k dial-up to an ISP or a cable modem to an ISP. In case the primary T1 goes down, I would like the router to automatically dial out over the modem conection and route all Internet bound traffic over that backup WAN connection, until the primary comes back online.
    Question 1:
    I'm assuming I need a router to do the intervlan routing. Could this router also do the on-demand WAN backup dialing to an ISP via analog modem?
    What IOS version and flavor (IP base, IP+, etc.) would I need? What is the cheapest router I can do all that with (i.e. 2620/2621/1720/3600 series)? What WIC's or NM's would I need?
    Question Two:
    I would like to prioritize PRIVATESSID's traffic over PUBLICSSID's traffic, which I know I can do on the access point. Can I do this on the router so that any 10.35.35.0 traffic takes priority over any 192.168.1.0 traffic?
    Question Three
    If the primary T1 WAN connection goes down, I don't want the router to re-route the 192.168.1.0 traffic over the backup 56k dial-up WAN connection. That traffic can wait until the T1 comes back up.
    Any help you can provide would be very much appreciated.

    Assuming your access points can place SSID into separate vlans and support 802.1q trunks then I can attempt to answer your questions. There are seperate secuity issues with both SSID for protection and VLANs for seperation but in your case in may be minimal.
    q1
    Any cisco router that will run 802.1q trunking will work. Since you are looking at older routers you will need IP+ to get it. Even 2610's will support 802.1q on their 10m ethernet at the correct code level but 10m and 802.1q is sorta nonstandard. Since your backup is only 56k you can use the internal modem port as a dial backup. A wic-2a/s will also work if you prefer not to use the modem port. You will need some wic to run your t1 line. If you are planning to leave the t1 on another router it makes the next 2 questions much harder.
    q2
    This is fairly simple and depends on your ios level. "priority queing" is supported on even the older software. I assume you do not control the far end of the t1 line since it sounds as if this goes to a ISP.
    You will need to have them do the QoS since most issues with the internet are inbound and not outbound. You can only control outbound traffic.
    q3
    If the T1 is on the same router then this is fairly simple. You can just put a floating static default route in that will cause the dialer to come up if the the t1 goes down. There is no easy way to protect against the line being up but no traffic passing. This is also why it would be best to have the t1 on the same router. If its not you will need to get very creative to solve this. You could build a GRE tunnel to a remote location and montior the tunnel or run a routing protcol over the tunnel. In the newest software you could use SAA and policy routing to force the traffic over the dialer but the router must support ios 12.4.
    3a. You mentioned a cable modem as a backup. That can be much easier sometimes since it is all routing and no dialer interfaces with nasty modem issues. This does not make the issue of the t1 not on the same router easier.

  • I need help to draw an image and move it plz plz : )

    Ok, so I have this whole code and I understand most of it but not all of it but I'm trying to make image "drop.gif" to move down the right side of the window. For each shot that is taken the image moves down ever so much and if the image hits the Entity ship "background" than notify death. PLease anyone help me !
    there are 7 classes but here is the main ...
    package spaceinvaderss;
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.image.BufferStrategy;
    import java.util.ArrayList;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class Main extends Canvas {
    /*A Canvas component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.
    An application must subclass the Canvas class in order to get useful functionality such as creating a custom component.
    The paint method must be overridden in order to perform custom graphics on the canvas.*/
    /** The stragey that allows us to use accelerate page flipping.*/
    private BufferStrategy strategy;
    /** True if the game is currently "running", i.e. the game loop is looping */
    private boolean gameRunning = true;
    /** The list of all the entities that exist in our game */
    private ArrayList entities = new ArrayList();
    /** The list of entities that need to be removed from the game this loop */
    private ArrayList removeList = new ArrayList();
    /** The entity representing the player */
    private Entity ship;
    /** The entity representing the alien */
    private Entity alien;
    /** The speed at which the player's ship should move (pixels/sec) */
    private double moveSpeed = 600;
    /** The time at which last fired a shot */
    private long lastFire = 0;
    /** The interval between our players shot (ms) */
    private long firingInterval = 400;
    /** timer */
    private long time = 0;
    /** The number of aliens left on the screen */
    private int alienCount;
    /** The message to display which waiting for a key press */
    private String message = "";
    /** True if we're holding up game play until a key has been pressed */
    private boolean waitingForKeyPress = true;
    /** True if the left cursor key is currently pressed */
    private boolean leftPressed = false;
    /** True if the right cursor key is currently pressed */
    private boolean rightPressed = false;
    /** True if we are firing */
    private boolean firePressed = false;
    /** True if game logic needs to be applied this loop, normally as a result of a game event */
    private boolean logicRequiredThisLoop = false;
    private static Image drop;
    /** The constant for the width*/
    private int DOMAIN = 800;
    /** The constant fot the length*/
    private int RANGE = 950;
    /** The constant for the number of rows of aliens */
    private int numbaofrows = 8;
    /** The constant for the number of aliens per row */
    private int aliensperrow = 12;
    /** The constant for the percent of which the speed increases*/
    private double speedincrease = 1.02;
    /** Starts the variable that counts the shots*/
    private int shotsfired = 0;
    /** Construct our game and set it running.*/
    public Main() {
    // Creates a frame to contain Main.
    JFrame container = new JFrame("SPACE INVADERS !!! WOOT !!! WOOT !!!");
    // Gets a hold of the content of the frame and sets up the resolution of the game
    // Names the inside of the "container" as panel.
    JPanel panel = (JPanel) container.getContentPane();
    // Stes the demensions of the panel.
    panel.setPreferredSize(new Dimension(DOMAIN,RANGE));
    //Sets the layout as nothing which overrides any automatic properties.
    panel.setLayout(null);
    // Sets up our canvas size and puts it into the content of the frame
    setBounds(0, 0, DOMAIN, RANGE);
    panel.add(this);
    // Tell AWT not to bother repainting our canvas since we're
    // going to do that our self in accelerated mode.
    setIgnoreRepaint(true);
    // Actually sizes the window approximately.
    container.pack();
    // Makes it so that the window can't be resized.
    container.setResizable(false);
    // Makes the window visible.
    container.setVisible(true);
    // Add a listener to respond to the user pressing the x.
    // End the program when the window is closed.
    container.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    // add a key input system (defined below) to our canvas
    // so we can respond to key pressed
    addKeyListener(new KeyInputHandler());
    // request the focus so key events come to us
    requestFocus();
    // Create the buffering strategy which will allow AWT
    // to manage our accelerated graphics.
    createBufferStrategy(2);
    strategy = getBufferStrategy();
    // initialise the entities in our game so there's something
    // to see at startup
    initEntities();
    time = System.currentTimeMillis();
    * Start a fresh game, this should clear out any old data and
    * create a new set.
    private void startGame() {
    // clear out any existing entities and intialise a new set
    entities.clear();
    initEntities();
    // blank out any keyboard settings we might currently have
    leftPressed = false;
    rightPressed = false;
    firePressed = false;
    * Initialise the starting state of the entities (ship and aliens). Each
    * entitiy will be added to the overall list of entities in the game.
    private void initEntities() {
    ClassLoader cloader = Main.class.getClassLoader();
    drop = Toolkit.getDefaultToolkit().getImage(cloader.getResource("drop.gif"));
    prepareImage(drop, this);
    // create the player ship and place it in the center of the screen
    ship = new ShipEntity(this,"background.gif", 0, (RANGE - 75));
    entities.add(ship);
    ship = new ShipEntity(this,"ship.gif", (DOMAIN / 2) - 0, (RANGE - 50));
    entities.add(ship);
    // create a block of aliens
    alienCount = 0;
    for (int row = 0; row < numbaofrows; row++) {
    for (int x = 0; x < aliensperrow; x++) {
    alien = new AlienEntity(this,"alien.gif", 100 + (x*50),(50)+row*30);
    entities.add(alien);
    alienCount++;
    * Notification from a game entity that the logic of the game
    * should be run at the next opportunity (normally as a result of some
    * game event)
    public void updateLogic() {
    logicRequiredThisLoop = true;
    * Remove an entity from the game. The entity removed will
    * no longer move or be drawn.
    * Remove the entity
    public void removeEntity(Entity entity) {
    removeList.add(entity);
    /**Notify that the player has died.*/
    public void notifyDeath() {
    message = "Oh no! The aliens win, wanna try again?";
    waitingForKeyPress = true;
    /** Notification that the player has won since all the aliensare dead.*/
    public void notifyWin() {
    long time2;
    time2 = (System.currentTimeMillis() - time) / 1000;
    int acuracy = 1000*(aliensperrow*numbaofrows)/shotsfired;
    message = "Congradulations! You win! Your time was: " + time2 + " seconds. Your acuracy was " + acuracy + "%.";
    waitingForKeyPress = true;
    /**Notification that an alien has been killed*/
    public void notifyAlienKilled() {
    // reduce the alient count, if there are none left, the player has won!
    alienCount--;
    if (alienCount == 0) {
    notifyWin();
    // if there are still some aliens left then they all need to get faster, so
    // speed up all the existing aliens
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    if (entity instanceof AlienEntity) {
    // speed up every time the aliens move down
    entity.setHorizontalMovement(entity.getHorizontalMovement() * speedincrease);
    /**Attempt to fire a shot from the player. Its called "try" since we must first
    * check that the player can fire at this point, i.e. has he/she waited long
    * enough between shots.*/
    public void tryToFire() {
    // check that we have been waiting long enough to fire
    if (System.currentTimeMillis() - lastFire < firingInterval) {
    return;
    // if we waited long enough, create the shot entity, and record the time.
    lastFire = System.currentTimeMillis();
    ShotEntity shot = new ShotEntity(this, "bullet.gif", ship.getX() + 27, ship.getY() - 30);
    entities.add(shot);
    * The main game loop. This loop is running during all game
    * play as is responsible for the following activities:
    * - Working out the speed of the game loop to update moves
    * - Moving the game entities
    * - Drawing the screen contents (entities, text)
    * - Updating game events
    * - Checking Input
    public void gameLoop() {
    long lastLoopTime = System.currentTimeMillis();
    // Keep looping around till the game ends.
    while (gameRunning) {
    // Work out how long its been since the last update, this
    // will be used to calculate how far the entities should
    // move this loop.
    long delta = System.currentTimeMillis() - lastLoopTime;
    lastLoopTime = System.currentTimeMillis();
    // Get hold of a graphics context for the accelerated
    // surface and black it out.
    Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
    g.setColor(Color.black);
    g.fillRect(0, 0, DOMAIN, RANGE);
    // Cycle around asking for each entity to move itself.
    if (!waitingForKeyPress) {
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.move(delta);
    // cycle round drawing all the entities we have in the game
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.draw(g);
    // brute force collisions, compare every entity against
    // every other entity. If any of them collide notify
    // both entities that the collision has occured
    for (int p = 0; p < entities.size(); p++) {
    for (int s = p + 1; s < entities.size(); s++) {
    Entity me = (Entity) entities.get(p);
    Entity him = (Entity) entities.get(s);
    if (me.collidesWith(him)) {
    me.collidedWith(him);
    him.collidedWith(me);
    // remove any entity that has been marked for clear up
    entities.removeAll(removeList);
    removeList.clear();
    // if a game event has indicated that game logic should
    // be resolved, cycle round every entity requesting that
    // their personal logic should be considered.
    if (logicRequiredThisLoop) {
    for (int i = 0; i < entities.size(); i++) {
    Entity entity = (Entity) entities.get(i);
    entity.doLogic();
    logicRequiredThisLoop = false;
    // if we're waiting for an "any key" press then draw the
    // current message
    if (waitingForKeyPress) {
    g.setColor(Color.green);
    g.drawString(message,(DOMAIN-g.getFontMetrics().stringWidth(message)) / 2, 250);
    g.drawString("TO PLAY, PRESS ANY KEY : )", (DOMAIN-g.getFontMetrics().stringWidth("TO PLAY, PRESS ANY KEY : )")) / 2, 40);
    // Clear up the graphics.
    g.dispose();
    // Flip the buffer over.
    strategy.show();
    // resolve the movement of the ship. First assume the ship
    // isn't moving. If either cursor key is pressed then
    // update the movement appropraitely
    ship.setHorizontalMovement(0);
    if ((leftPressed) && (!rightPressed)) {
    ship.setHorizontalMovement(-moveSpeed);
    } else if ((rightPressed) && (!leftPressed)) {
    ship.setHorizontalMovement(moveSpeed);
    // if we're pressing fire, attempt to fire
    if (firePressed) {
    shotsfired++;
    tryToFire();
    // finally pause for a bit. Note: this should run us at about
    // 100 fps but on windows this might vary each loop due to
    // a bad implementation of timer
    try { Thread.sleep(10); } catch (Exception e) {}
    * A class to handle keyboard input from the user. The class
    * handles both dynamic input during game play, i.e. left/right
    * and shoot, and more static type input (i.e. press any key to
    * continue)
    * This has been implemented as an inner class more through
    * habbit then anything else. Its perfectly normal to implement
    * this as seperate class if slight less convienient.
    private class KeyInputHandler extends KeyAdapter {
    /** The number of key presses we've had while waiting for an "any key" press */
    private int pressCount = 1;
    * Notification from AWT that a key has been pressed. Note that
    * a key being pressed is equal to being pushed down but NOT
    * released. Thats where keyTyped() comes in.
    * @param e The details of the key that was pressed
    public void keyPressed(KeyEvent e) {
    // if we're waiting for an "any key" typed then we don't
    // want to do anything with just a "press"
    if (waitingForKeyPress) {
    return;
    if (e.getKeyCode() == KeyEvent.VK_LEFT) {
    leftPressed = true;
    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
    rightPressed = true;
    if (e.getKeyCode() == KeyEvent.VK_SPACE) {
    firePressed = true;
    * Notification from AWT that a key has been released.
    * @param e The details of the key that was released
    public void keyReleased(KeyEvent e) {
    // if we're waiting for an "any key" typed then we don't
    // want to do anything with just a "released"
    if (waitingForKeyPress) {
    return;
    if (e.getKeyCode() == KeyEvent.VK_LEFT) {
    leftPressed = false;
    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
    rightPressed = false;
    if (e.getKeyCode() == KeyEvent.VK_SPACE) {
    firePressed = false;
    * Notification from AWT that a key has been typed. Note that
    * typing a key means to both press and then release it.
    * @param e The details of the key that was typed.
    public void keyTyped(KeyEvent e) {
    // if we're waiting for a "any key" type then
    // check if we've recieved any recently. We may
    // have had a keyType() event from the user releasing
    // the shoot or move keys, hence the use of the "pressCount"
    // counter.
    if (waitingForKeyPress) {
    if (pressCount == 1) {
    // since we've now recieved our key typed
    // event we can mark it as such and start
    // our new game
    waitingForKeyPress = false;
    startGame();
    pressCount = 0;
    } else {
    pressCount++;
    // if we hit escape, then quit the game
    if (e.getKeyChar() == 27) {
    System.exit(0);
    * The entry point into the game. We'll simply create an
    * instance of class which will start the display and game
    * loop.
    * @param argv The arguments that are passed into our game
    public static void main(String argv[]) {
    Main g = new Main();
    // Starts the main game loop, this method will not return until the game has finished running. Hence we are
    // using the actual main thread to run the game.
    g.gameLoop();
    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Ap_Compsci_student_13 wrote:
    ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long.

  • Need help with trim and null function

    Hi all,
    I need help with a query. I use the trim function to get the first three characters of a string. How do I write my query so if a null value occurs in combination with my trim to say 'Null' in my results?
    Thanks

    Hi,
    Thanks for the reply. What am I doing wrong?
    SELECT trim(SUBSTR(AL1.user_data_text,1,3)),NVL
    (AL1.user_data_text,'XX')
    FROM Table
    I want the XX to appear in the same column as the
    trim.The main thing you're doing wrong is not formatting your code. The solution may become obvious if you do.
    What you're saying is:
    SELECT  trim ( SUBSTR (AL1.user_data_text, 1, 3))
    ,       NVL ( AL1.user_data_text, 'XX' )
    FROM    Tablewhich makes it clear that you're SELECTing two columns, when you only want to have one.
    If you want that column to be exactly like the first column you're currently SELECTing, except that when that column is NULL you want it to be 'XX', then you have to apply NVL to that column, like this:
    SELECT  NVL ( trim ( SUBSTR (AL1.user_data_text, 1, 3))
                , 'XX'
    FROM    Table

Maybe you are looking for

  • App Store

    My iPod touch will no longer connect to the App Store.  WiFi connection is not the problem.  Also, when opening iTunes it says it does not recognize the server and warns of a possible imitation site... How can I restore the access to the App Store?

  • 6230i - incorrectly ascending ringing volume / bad...

    Dear Nokia, There are two main problems with the 6230i phone, which have been making my life hell! 1) This has been discussed on numerous posts in the forum - the fact that even on level 5, constant ringing - the phone will ascend. I understand this

  • Error message after deploying Web Dynpro App.

    Hi everyone, I am having the following problem when trying to run my WD app after deploying it. The funny thing about this issue is I deployed this application earlier and it was working fine. But about an hour later I tried to access it again and go

  • Oracle CRM On Demand Release 16 Patch Release Notes 1080.0.0

    Oracle CRM On Demand Release 16 Patch Release Notes 1080.0.0 is now available on MetaLink. The document ID is 860682.1

  • Deleting versions from external editor

    I am sure this question has come up before, but I cannot seem to find it in a forum search. I have my original RAW in Aperture. I use the "Open with external editor" command, make changes in PhotoShop and save. Aperture now has the "original" RAW and