1 / 23

Getting Started

Getting Started. 2007. 3. 9 ( 금 ) 김 희 준 icemichy@hufs.ac.kr. 실습준비. 실습 서버 amg.hufs.ac.kr OS : Red hat Linux 9 Intel x86 220.67.124.140 OS : Red hat Linux 9 Intel x86 220.67.124.129 OS : Solaris 5.8 SPARC 세 개의 계정 배정. 실습 시 주의사항 (1/3). 실습용 서버주소 : amg.hufs.ac.kr

oprah
Télécharger la présentation

Getting Started

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Getting Started 2007. 3. 9 (금) 김 희 준 icemichy@hufs.ac.kr

  2. 실습준비 • 실습 서버 • amg.hufs.ac.kr • OS : Red hat Linux 9 • Intel x86 • 220.67.124.140 • OS : Red hat Linux 9 • Intel x86 • 220.67.124.129 • OS : Solaris 5.8 • SPARC • 세 개의 계정 배정

  3. 실습 시 주의사항 (1/3) • 실습용 서버주소 : amg.hufs.ac.kr [Allocation of port numbers] • 자신에게 정해진 port만 사용 • port number : ‘5xxxx’ 부터 +10까지 학번 뒤에 4자리 ex) 학번이 200430128 일때  50128~50138까지

  4. Command Line Tool • SSH secure shell • 네트워크의 다른 컴퓨터에 로그인 할 수 있으며 원격 시스템에서 명령을 실행하고 다른 시스템으로 파일을 복사할 수 있도록 해주는 프로그램 • ftp://ftp.kreonet.re.kr/pub/security/ssh/ • SSHSecureShellClient-3.2.9.exe 파일 다운 받아 설치 • 기능 • 원격 호스트에 로그인 하거나 호스트끼리 데이터를 복사하기 위해 사용 • 강력한 인증방법과 안전하지 못한 네트워크에서 안전하게 통신을 할 수 있는 기능을 제공 • SSH는 두 호스트간의 통신 암호화와 사용자 인증을 위하여 공개 열쇠 암호 기법을 사용 • 세션 하이젝킹(Session Hijacking)과 DNS 스푸핑을 방지

  5. SSH secure shell • Main Window • Green : Will connect Remote Host • Violet : Register Remote Host • Red : New Terminal • Blue : New File Transfer

  6. SSH secure shell • Connecting host • Click Connect or Quick Connect • Connecting host • Input Parameters • Host IP or Domain Name • ID, Password • Port • Connecting host • Result

  7. SSH secure shell • File Transfer

  8. UNP Library (1/2) • Wrapper function - W. Richard Stevens • Solaris, Linux, FreeBSD 등에 설치 가능 • Libunp.a, libfree.a, libroute.a, libxti.a로 구성 ※ XTI [ X/Open Transport Interface ] OSI 기본 참조 모델의 제4계층(transport layer)에서의 응용 프로그램 인터페이스(API)에 대한 X/Open의 규정. 이 API를 사용하면 제3계층 이하의 어떤 망 방식을 사용하든 관계없이 망 응용 프로그램을 작성할 수 있다.

  9. unpv13e 각 chapter의 source code (ex> intro, select…) config*.* lib libunp.a libfree UNP library (2/2) • UNP library의 directory 구조 • config*.* : library 설치관련 파일 ex> config.h, config.h.in, config.log, config.status, configure.in 등 • libunp.a : UNP library archive 파일 • lib, libfree : library에서 추가한 함수들의 object 파일

  10. tar xvfz unpv13e.tar.gz UNP library - install • http://www.unpbook.com/unpv13e.tar.gz • SSH Secure Shell 을 이용하여 file upload • 압축해제 gunzip unpv13e.tar.gz tar xvf unpv13e.tar • 설치방법 cd unpv13e # into the basic directory that all programs need ./configure # try to figure out all implementation differences cd lib # build the basic library that all programs need make # use "gmake" everywhere on BSD/OS systems cd ../libfree # continue building the basic library make cd ../intro # build and test a basic client program make daytimetcpcli ./daytimetcpcli 127.0.0.1

  11. Source Editing Tool • Source Insight • 객체지향의 프로그램 편집기 • 코드 브라우저로 C/C++, C# 및 Java program의 분석기를 내장 • 소스 코드를 분석하여 작업 중에 동적으로 기호정보에 관한 자체 데이터베이스를 유지 • 자동적으로 유용한 문맥(contextual) 정보를 제공 • 소스코드 및 소스정보를 빨리 찾아주는 기능 • 소스편집도중 소스코드와 소스정보를 빠르게 찾아 바로 유용한 정보 및 분석을 제공

  12. Source Insight (Main Window)

  13. Source Insight 사용 (1/4) • Project 를 생성

  14. Source Insight 사용 (2/4) • 환경설정 및 Source가 위치할 디렉토리 선택

  15. Source Insight 사용 (3/4) • 참고 및 소스확인이 필요한 파일들 프로젝트에 첨부

  16. Source Insight 사용 (4/4) • 소스 에디팅

  17. 원격 디렉토리 관리 • 네트워크 드라이브 연결 • 한번 등록으로 계속 사용 • 사용방법 • 탐색기의 도구창의 네트워크 드라이브 기능 • 직접 접속 연결 • 사용시 직접 ip address 입력을 통한 연결 • 컴퓨터 전원 오프시나 창을 닫은 후에는 다시 연결 필요 • 사용방법 • 시작의 실행 창 클릭 • Ip address 입력

  18. Netstat • 활성화된 연결에 대한 여러 네트워크 관련 데이터 구조의 내용을 표시 • 열려있는 포트번호 같은 네트워크 상태를 확인하기 위해 사용 • Command option

  19. Netstat (실행 화면)

  20. Linux Command • 디렉토리 생성 • # mkdir directory_name • Compile Example • Makefile 사용 • Simple Makefile Example

  21. Linux Command • ltrace • Library call tracer • 프로세스가 호출하는 공유 library 함수를 출력 • 사용방법 • # ltrace 실행파일명 • 실행되는 프로그램에서 호출하는 공유 library 함수를 출력 • # ltrace –f 실행파일명 • Fork된 자식 프로세스가 요청하는 공유 library 함수까지 출력 • # ltrace –p [PID] • 현재 실행되고 있는 프로세스의 함수요청을 출력 • # ltrace –S 실행파일명 • 시스템콜과 함수 호출 모두 출력

  22. Program Compile & Run test - Echo client (1/2) • 주어진 source를 참고하여 Source insight로 echo client를 작성 int main(int argc, char **argv) { int sockfd; struct sockaddr_in servaddr; /* Echo client의 argument확인하는 부분 추가 - argv[1] : server의 IP address - argv[2] : server의 port number (default:7) */ sockfd = socket(AF_INET, SOCK_STREAM, 0); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(7); inet_pton(AF_INET, argv[1], &servaddr.sin_addr); connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)); /* 사용자의 입력을 받아 echo서버로 전송하고 서버로부터의 데이터를 화면에 출력(교재 p.88 참고) */ exit(0); }

  23. Program Compile & Run test - Echo client (1/2) • 요구사항 • UNP library를 사용하지 말것 • 소스 디렉토리는 따로 생성 ( unp 폴더 밑에 생성금지 ) • 실행 옵션 • echo_client [Server IP address] [port_number] • argument를 주지 않았을 경우 사용방법 출력 ex) usage : echo_client [server IP address] [port_num] • ‘port_number’ argument를 주지 않았을 경우 기본값(50007)으로 처리 • 각 API의 에러처리 • 완성된 echo client를 220.67.124.140에서 실행하여 amg.hufs.ac.kr(220.67.124.142)과 테스트 • 참고자료 • David A. Curry, UNIX System Programming for SVR4, O’Reilly • 프로그램 Run 이전과 이후의 네트워크 상태 변화 체크 • Netstat를 이용하여 확인 • ltrace를 사용하여 주어진 프로그램의 상태 체크 ( for debugging )

More Related